Beispiel #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
        }
Beispiel #2
0
 public override void OnStartServer()
 {
     NetMsgCallbacks.RegisterHandler(CLIENT_SND_ID, OnServerRcv, true);
 }
Beispiel #3
0
 public override void OnStartClient()
 {
     NetMsgCallbacks.RegisterHandler(SERVER_SND_ID, OnClientRcv, false);
 }