示例#1
0
    public static void AddBehavior(HonoBehavior h)
    {
        Int32 num = HonoBehaviorSystem.Instance._GetCurrentJustAddList().IndexOf(h);

        if (num != -1)
        {
            return;
        }
        h.HonoAwake();
        HonoBehaviorSystem.Instance._GetCurrentJustAddList().Add(h);
    }
示例#2
0
    public static void RemoveBehavior(HonoBehavior h, Boolean dispose = false)
    {
        if (HonoBehaviorSystem._instance == (UnityEngine.Object)null)
        {
            return;
        }
        Int32 num = HonoBehaviorSystem.Instance._justRemoveList.IndexOf(h);

        if (num != -1)
        {
            return;
        }
        HonoBehaviorSystem.Instance._justRemoveList.Add(h);
        if (dispose)
        {
            HonoBehaviorSystem.Instance._justDisposeList.Add(h.gameObject);
        }
    }
示例#3
0
 private static void RemoveGameObject(GameObject gameObject)
 {
     if (gameObject == (UnityEngine.Object)null)
     {
         return;
     }
     HonoBehavior[] componentsInChildren = gameObject.GetComponentsInChildren <HonoBehavior>();
     HonoBehavior[] array = componentsInChildren;
     for (Int32 i = 0; i < (Int32)array.Length; i++)
     {
         HonoBehavior honoBehavior = array[i];
         Int32        num          = HonoBehaviorSystem.Instance._behaviorList.IndexOf(honoBehavior);
         if (num != -1)
         {
             HonoBehaviorSystem.Instance._behaviorList.RemoveAt(num);
             UnityEngine.Object.Destroy(honoBehavior);
         }
     }
     UnityEngine.Object.Destroy(gameObject);
 }