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

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