public void Update()
    {
        for (int i = 0; i < effectdic.Count; i++)
        {
            CActionEffect ae = effectdic[i];
            if (ae == null)
            {
                effectdic.RemoveAt(i);
                break;
            }
            ae.Update();
        }

        OnUpdate();

        //防止同一帧执行StopEvent和DoEvent
        if (isDoEvent)
        {
            isDoEvent = false;
            return;
        }
        if (bornTime > 0 && this.config.EndTime > 0 && !GameTimer.Within(bornTime, this.config.EndTime))
        {
            StopEvent();
            Dispose();
        }
    }
    protected T CreateEffect <T>(string source = null) where T : CActionEffect
    {
        T effect = CActionEffect.CreateEffect <T>(source, this, source);

        if (effect == null)
        {
            return(null);
        }
        effectdic.Add(effect);
        farther.AddEffect(effect);
        return(effect);
    }
 public void Reset()
 {
     for (int i = 0; i < effectdic.Count; i++)
     {
         CActionEffect ae = effectdic[i];
         if (ae == null)
         {
             continue;
         }
         ae.Destroy();
     }
     effectdic.Clear();
 }
Exemple #4
0
 public void AddEffect(CActionEffect effect)
 {
     if (effect == null)
     {
         return;
     }
     for (int i = 0; i < effectdic.Count; i++)
     {
         CActionEffect ae = effectdic[i];
         if (ae == null)
         {
             continue;
         }
     }
     effectdic.Add(effect);
 }