Beispiel #1
0
        public static void SendEvent(int guid, CEvent e)
        {
            NetBehaviour behaviour = GUIDPool.GetBehaviour(guid);

            if (behaviour != null)
            {
                behaviour.AcceptEvent(e);
            }
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
 public static T GetObject<T>(int id) where T : Component
 {
     NetBehaviour behaviour = GetBehaviour(id);
     return behaviour?.GetComponent<T>();
 }