public void Awake() { instance = this; foreach(ReservedGUID res in FindObjectsOfType<ReservedGUID>()) { var id = new NetGUID(res.id); NetBehaviour netBehaviour = res.GetComponent<NetBehaviour>(); netBehaviour?.SetGUID(id); id.behaviour = netBehaviour; current = System.Math.Max(current, res.id + 1); } }
public static NetBehaviour Create <T>(GameObject gameObject, int owner, NetGUID guid) where T : NetBehaviour { var behaviour = gameObject.AddComponent <T>(); behaviour.guid = guid; guid.behaviour = behaviour; behaviour.PrivateInit(owner); behaviour.Init(); return(behaviour); }
/// <summary> /// Send a GUID broadcast to the appropriate object /// </summary> /// <param name="gb"></param> private static void ProcessGUIDBroadcast(GUIDBroadcast gb) { NetGUID.SendEvent(gb.guid, gb.e); }
private void _AddToMap(NetGUID guid) { map.Add(guid.id, guid); }
public static void AddToMap(NetGUID guid) { instance?._AddToMap(guid); }
private void _AddGUID(NetGUID guid) { waitingGUIDs.Enqueue(guid); NetworkClient.SendObjectToServerTCP(NetworkControlCode.runOnServer, new GUIDRequest()); }
public static void AddGUID(NetGUID guid) { instance?._AddGUID(guid); }
public void BroadcastToSelfUdp(NetworkedCEvent e) { NetGUID.SendEventToServerUdp(guid.id, e); }
public void SetGUID(NetGUID guid) { this.guid = guid; }