Example #1
0
        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);
            }
        }
Example #2
0
        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);
        }
Example #3
0
 /// <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);
 }
Example #4
0
 private void _AddToMap(NetGUID guid)
 {
     map.Add(guid.id, guid);
 }
Example #5
0
 public static void AddToMap(NetGUID guid)
 {
     instance?._AddToMap(guid);
 }
Example #6
0
 private void _AddGUID(NetGUID guid)
 {
     waitingGUIDs.Enqueue(guid);
     NetworkClient.SendObjectToServerTCP(NetworkControlCode.runOnServer, new GUIDRequest());
 }
Example #7
0
 public static void AddGUID(NetGUID guid)
 {
     instance?._AddGUID(guid);
 }
Example #8
0
 public void BroadcastToSelfUdp(NetworkedCEvent e)
 {
     NetGUID.SendEventToServerUdp(guid.id, e);
 }
Example #9
0
 public void SetGUID(NetGUID guid)
 {
     this.guid = guid;
 }