示例#1
0
        private void Start()
        {
            /// Register our methods as Unet Msg Receivers
            NetMsgCallbacks.RegisterHandler(CLIENT_SND_ID, OnServerRcv, true);
            NetMsgCallbacks.RegisterHandler(SERVER_SND_ID, OnClientRcv, false);

            /// Add this component to the dictionary of netobjects. Netid is used as the key.
#if PUN_2_OR_NEWER
            players.Add((int)photonView.ViewID, this);
#else
            players.Add(NetId, this);
#endif
        }
示例#2
0
 public override void OnStartServer()
 {
     NetMsgCallbacks.RegisterHandler(CLIENT_SND_ID, OnServerRcv, true);
 }
示例#3
0
 public override void OnStartClient()
 {
     NetMsgCallbacks.RegisterHandler(SERVER_SND_ID, OnClientRcv, false);
 }