Unity3D 客户端编程
Photon Server 和 Unity3D 数据交互: Photon Server 服务端编程 Unity3D 客户端编程 1:打开unity新建新项目,并引入Photon3Unity3D.dll到plugins文件中。 2、新建一个空物体,添加两个脚本文件。 1 using System.Collections; 2 using System.Collections.Generic; 3 using UnityEngine; 4 using ExitGames.Client.Photon; 5 using System; 6 7 public class PhotonEngine : MonoBehaviour, IPhotonPeerListener 8 { 9 //单例模式 10 private static PhotonEngine instance; 11 private static PhotonPeer peer; 12 13 public static PhotonPeer Peer 14 { 15 get 16 { 17 return peer; 18 } 19 } 20 21 private void Awake() 22 { 23 if (instance == null) 24 { 25 instance = this; 26 //不需要销毁 27