Ejemplo n.º 1
0
        protected void CreateNode(NodeType type, string nodeName = null)
        {
            if (this._nodeGoHandle != null)
            {
                return;
            }
            this._nodeGo = null;
            switch (type)
            {
            case NodeType.SkillNode:
                this._nodeGo      = BaseAction.AllocNode(type, false);
                this._nodeGo.name = "SkillNode";
                break;

            case NodeType.EffectNode:
                this._nodeGo      = BaseAction.AllocNode(type, false);
                this._nodeGo.name = "EffectNode";
                break;

            case NodeType.DamageNode:
                this._nodeGo      = BaseAction.AllocNode(type, false);
                this._nodeGo.name = "DamageNode";
                break;
            }
            this._nodeGo.transform.parent = BaseAction.GetNodeParent(type);
            BaseAction.s_stat.createNodeCnt++;
        }
Ejemplo n.º 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));
     }
 }