Exemplo n.º 1
0
 public void Release()
 {
     while (mHitDefinitions.Count > 0)
     {
         HitDefinition tmpHitDef = mHitDefinitions.Dequeue();
         tmpHitDef.Release();
     }
 }
Exemplo n.º 2
0
        public void CreateHitDefinition(ActData.AttackDef data, IActUnit owner, string action, ISkillItem skillItem)
        {
            HitDefinition tmpHitDef = mHitDefPool.Spawn();

            tmpHitDef.CacheTransform.SetParent(mHitDefRoot, false);
            tmpHitDef.Init(data, owner, action, skillItem, OnFinishHandle);
            mHitDefList.Add(tmpHitDef);
        }
Exemplo n.º 3
0
            public HitDefinition Spawn()
            {
                HitDefinition tmpHitDef = null;

                if (mHitDefinitions.Count > 0)
                {
                    tmpHitDef = mHitDefinitions.Dequeue();
                }
                else
                {
                    tmpHitDef = new HitDefinition();
                }

                return(tmpHitDef);
            }
Exemplo n.º 4
0
 public void DeSpawn(HitDefinition hitDefinition)
 {
     hitDefinition.CacheTransform.SetParent(mHitDefPoolRoot, false);
     mHitDefinitions.Enqueue(hitDefinition);
 }
Exemplo n.º 5
0
 private void OnFinishHandle(HitDefinition hitDefinition)
 {
     mHitDefList.Remove(hitDefinition);
     hitDefinition.Reset();
     mHitDefPool.DeSpawn(hitDefinition);
 }