Example #1
0
 protected virtual void OnDestroy()
 {
     BaseAction.s_stat.destroyCnt++;
     if (this.gameObject)
     {
     }
     if (this._nodeGoHandle != null)
     {
         BaseAction.s_stat.destroyNodeCnt++;
         ResourceHandle.SafeRelease(ref this._nodeGoHandle);
         this._nodeGo = null;
     }
     if (this._nodeGo != null)
     {
         BaseAction.ReleaseNode(this._nodeGo);
         this._nodeGo = null;
     }
 }
Example #2
0
 /// <summary>
 /// 分配对象池
 /// </summary>
 public static void AllocNodePool()
 {
     if (BaseAction.skillNodePool == null)
     {
         BaseAction.skillNodePool = new GameObject("SkillNodePool");
     }
     if (BaseAction.childSkillNodePool == null)
     {
         BaseAction.childSkillNodePool = new GameObject("ChildSkillNodePool");
     }
     for (int i = 0; i < BaseAction.nodePool.Count; i++)
     {
         if (BaseAction.nodePool[i] != null)
         {
             UnityEngine.Object.Destroy(BaseAction.nodePool[i]);
         }
     }
     BaseAction.nodePool.Clear();
     for (int j = 0; j < 1; j++)
     {
         BaseAction.ReleaseNode(BaseAction.AllocNode(NodeType.None, true));
     }
 }