Beispiel #1
0
 public void Release()
 {
     while (mHitDefinitions.Count > 0)
     {
         HitDefinition tmpHitDef = mHitDefinitions.Dequeue();
         tmpHitDef.Release();
     }
 }
Beispiel #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);
        }
Beispiel #3
0
            public HitDefinition Spawn()
            {
                HitDefinition tmpHitDef = null;

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

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