Пример #1
0
        void Remove(UInt16 id)
        {
            DynamicFrameSyncBehaviour behaviour = _behaviours[id];

            _behaviours.Remove(id);
            DynamicFrameSyncBehaviourSpawner._Destroy(behaviour.gameObject);
        }
Пример #2
0
        void Remove(DynamicFrameSyncBehaviour behaviour)
        {
            UInt16 id = behaviour.FrameSyncBehaviourID;

            _behaviours.Remove(id);

            DynamicFrameSyncBehaviourSpawner._Destroy(behaviour.gameObject);
        }
Пример #3
0
        DynamicFrameSyncBehaviour Add(UInt16 index, UInt16 prefabId)
        {
            GameObject gameObject = DynamicFrameSyncBehaviourSpawner._Instantiate(prefabId);
            DynamicFrameSyncBehaviour behaviour = gameObject.AddComponent <DynamicFrameSyncBehaviour>();

            behaviour._prefabIndex = prefabId;
            behaviour._id          = index;
            _behaviours[index]     = behaviour;

            return(behaviour);
        }
Пример #4
0
        public DynamicFrameSyncBehaviourManager()
        {
            _behaviours                = new SortedList <ushort, DynamicFrameSyncBehaviour>();
            _bufferedNewBehaviours     = new List <DynamicFrameSyncBehaviour>();
            _bufferedRemovedBehaviours = new List <DynamicFrameSyncBehaviour>();
            _nextDynamicBehaviourIndex = 1;

            DynamicFrameSyncBehaviourSpawner.Init();
            DynamicFrameSyncBehaviourSpawner.OnGameObjectCreated   += _behaviourSpawner_OnGameObjectCreated;
            DynamicFrameSyncBehaviourSpawner.OnGameObjectDestroyed += _behaviourSpawner_OnGameObjectDestroyed;
        }