예제 #1
0
 public void DestroyParticleAnimation(ParticleAnimation ani)
 {
     if (ani != null)
     {
         ani.Destroy();
     }
 }
예제 #2
0
 public void Clear()
 {
     mWingSprite   = null;
     mDaChengState = null;
     if (mWingPicAni != null)
     {
         mWingPicAni.Destroy();
         mWingPicAni = null;
     }
     mDaChengPicList.Clear();
     GameObject.DestroyImmediate(mView);
 }
예제 #3
0
    public void Update()
    {
        IDictionaryEnumerator itr = mParticleAnimations.GetEnumerator();

        while (itr.MoveNext())
        {
            ParticleAnimation item = itr.Value as ParticleAnimation;

            uint key = Convert.ToUInt32(itr.Key);

            //检测特效是否播放完成
            if (item == null || item.IsDead())
            {
                //自然消失的特效放在这里,管理器将其销毁
                if (item != null)
                {
                    mDestroys.Add(key);
                }
            }
            else
            {
                item.OnUpdate();
            }
        }


//         for (int i = 0; i < mParticleAnimations.Keys.Count; ++i )
//         {
//             uint key = mParticleAnimations.Keys.ElementAt(0);
//             if (!mParticleAnimations.ContainsKey(key))
//                 continue;
//
//
//         }

        for (int i = 0; i < mDestroys.Count; ++i)
        {
            uint key = mDestroys[i];

            if (mParticleAnimations.ContainsKey(key))
            {
                ParticleAnimation item = mParticleAnimations[key];

                mParticleAnimations.Remove(key);

                item.Destroy();
            }
        }

        mDestroys.Clear();
    }