Exemplo n.º 1
0
        public void RegisterBehaviour(ManagedBehaviour a_behaviour)
        {
            if (_Behaviours.Find(existing => existing.Equals(a_behaviour)))
            {
                Debug.Log("Attempted to add existing behaviour to manager!");
                return;
            }

            _Behaviours.Add(a_behaviour);

            if (a_behaviour.GetType().GetMethod("ManagedUpdate").isOverridden())
            {
                _regularBehaviours.Add(a_behaviour);
            }

            if (a_behaviour.GetType().GetMethod("ManagedLateUpdate").isOverridden())
            {
                _lateBehaviours.Add(a_behaviour);
            }

            if (a_behaviour.GetType().GetMethod("ManagedFixedUpdate").isOverridden())
            {
                _fixedBehaviours.Add(a_behaviour);
            }
        }
Exemplo n.º 2
0
        public void DeregisterBehaviour(ManagedBehaviour a_behaviour)
        {
            if (!_Behaviours.Find(existing => existing.Equals(a_behaviour)))
            {
                Debug.Log("Attempted to deregister non existent behaviour from manager!");
                return;
            }

            _Behaviours.Remove(a_behaviour);
        }