Beispiel #1
0
 private void Update()
 {
     this.CheckMats();
     if (this.oldMats != null && this.mats != null)
     {
         if (this.playingEffects != null && this.playingEffects.get_Count() > 0)
         {
             for (int i = 0; i < this.playingEffects.get_Count(); i++)
             {
                 SMaterialEffect_Base sMaterialEffect_Base = this.playingEffects.get_Item(i);
                 sMaterialEffect_Base.OnMeshChanged(this.oldMats, this.mats);
             }
         }
         this.oldMats = null;
     }
     if (this.playingEffects != null && this.playingEffects.get_Count() > 0)
     {
         for (int j = 0; j < this.playingEffects.get_Count(); j++)
         {
             SMaterialEffect_Base sMaterialEffect_Base2 = this.playingEffects.get_Item(j);
             if (sMaterialEffect_Base2.Update())
             {
                 sMaterialEffect_Base2.Release();
                 this.playingEffects.RemoveAt(j);
                 j--;
             }
         }
     }
 }
    private T FindOrCreateEffect <T>(int type) where T : SMaterialEffect_Base, new()
    {
        if (this.playingEffects != null)
        {
            for (int i = 0; i < this.playingEffects.Count; i++)
            {
                SMaterialEffect_Base base2 = this.playingEffects[i];
                if (base2.type == type)
                {
                    if (base2 is T)
                    {
                        return(base2 as T);
                    }
                    base2.Stop();
                    base2.Release();
                    this.playingEffects.RemoveAt(i);
                    break;
                }
            }
        }
        T item = ClassObjPool <T> .Get();

        item.type      = type;
        item.owner     = this;
        item.bChkReset = false;
        item.AllocId();
        if (this.playingEffects == null)
        {
            this.playingEffects = new ListView <SMaterialEffect_Base>();
        }
        this.playingEffects.Add(item);
        return(item);
    }
Beispiel #3
0
 private void Update()
 {
     this.CheckMats();
     if ((this.oldMats != null) && (this.mats != null))
     {
         if ((this.playingEffects != null) && (this.playingEffects.Count > 0))
         {
             for (int i = 0; i < this.playingEffects.Count; i++)
             {
                 this.playingEffects[i].OnMeshChanged(this.oldMats, this.mats);
             }
         }
         this.oldMats = null;
     }
     if ((this.playingEffects != null) && (this.playingEffects.Count > 0))
     {
         for (int j = 0; j < this.playingEffects.Count; j++)
         {
             SMaterialEffect_Base base3 = this.playingEffects[j];
             if (base3.Update())
             {
                 base3.Release();
                 this.playingEffects.RemoveAt(j);
                 j--;
             }
         }
     }
 }
 private void Update()
 {
     this.CheckMats();
     if ((this.playingEffects != null) && (this.playingEffects.Count > 0))
     {
         for (int i = 0; i < this.playingEffects.Count; i++)
         {
             SMaterialEffect_Base base2 = this.playingEffects[i];
             if (base2.Update())
             {
                 base2.Release();
                 this.playingEffects.RemoveAt(i);
                 i--;
             }
         }
     }
 }
Beispiel #5
0
    private T FindOrCreateEffect <T>(int type) where T : SMaterialEffect_Base, new()
    {
        if (this.playingEffects != null)
        {
            int i = 0;
            while (i < this.playingEffects.get_Count())
            {
                SMaterialEffect_Base sMaterialEffect_Base = this.playingEffects.get_Item(i);
                if (sMaterialEffect_Base.type == type)
                {
                    if (!(sMaterialEffect_Base is T))
                    {
                        sMaterialEffect_Base.Stop();
                        sMaterialEffect_Base.Release();
                        this.playingEffects.RemoveAt(i);
                        break;
                    }
                    return(sMaterialEffect_Base as T);
                }
                else
                {
                    i++;
                }
            }
        }
        T t = ClassObjPool <T> .Get();

        t.type      = type;
        t.owner     = this;
        t.bChkReset = false;
        t.AllocId();
        if (this.playingEffects == null)
        {
            this.playingEffects = new ListView <SMaterialEffect_Base>();
        }
        this.playingEffects.Add(t);
        return(t);
    }
Beispiel #6
0
 private void StopEffect(SMaterialEffect_Base effect)
 {
     effect.Stop();
     effect.Release();
     this.playingEffects.Remove(effect);
 }