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