Пример #1
0
        //--------------------------------------------------------------------------------------------/
        // Static Methods
        //--------------------------------------------------------------------------------------------/
        /// <summary>
        /// Instantiates this behaviour at runtime, adding it to the managed behaviour system
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static T Instantiate <T>() where T : ManagedBehaviour
        {
            T behaviour = Instantiate <T>();

            ManagedBehaviourSystem.Add(behaviour);
            return(behaviour);
        }
Пример #2
0
 /// <summary>
 /// Destroys this behaviour, removing it from the managed behaviour system
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="behaviour"></param>
 public static void Destroy <T>(T behaviour) where T : ManagedBehaviour
 {
     ManagedBehaviourSystem.Remove(behaviour);
     Destroy(behaviour);
 }
Пример #3
0
 private void OnDestroy()
 {
     ManagedBehaviourSystem.Remove(this);
     this.OnManagedDestroy();
 }
Пример #4
0
 //--------------------------------------------------------------------------------------------/
 // Methods
 //--------------------------------------------------------------------------------------------/
 private void Awake()
 {
     ManagedBehaviourSystem.Add(this);
     this.OnManagedAwake();
 }