Exemple #1
0
 private void OnDestroy()
 {
     if (!this.mbRemove && DestroyForTime.monDestroyEffect != null)
     {
         this.mbRemove = true;
         DestroyForTime.monDestroyEffect(base.gameObject, true);
     }
 }
Exemple #2
0
 private void Update()
 {
     if (Time.time - this.fStartTime > this.time)
     {
         if (DestroyForTime.monDestroyEffect != null)
         {
             this.mbRemove = true;
             DestroyForTime.monDestroyEffect(base.gameObject, true);
         }
         else
         {
             UnityEngine.Object.Destroy(base.gameObject);
         }
     }
 }
Exemple #3
0
    private void PlayObject()
    {
        if (this.mGoEffect == null)
        {
            return;
        }
        GameObject gameObject = UnityEngine.Object.Instantiate(this.mGoEffect, Vector3.zero, Quaternion.identity) as GameObject;

        if (gameObject == null)
        {
            return;
        }
        gameObject.transform.parent        = base.transform;
        gameObject.transform.localRotation = this.mGoEffect.transform.localRotation;
        gameObject.transform.localScale    = this.mGoEffect.transform.localScale;
        gameObject.transform.localPosition = this.mGoEffect.transform.localPosition + this.mvecOffset;
        gameObject.SetActive(true);
        DestroyForTime destroyForTime = gameObject.AddComponent <DestroyForTime>();

        destroyForTime.time = this.mfLiveTime;
    }
Exemple #4
0
 public static void ResetEffect(GameObject oEffect)
 {
     if (oEffect == null)
     {
         return;
     }
     if (oEffect.layer == SpawnPool.miEffectLayer || oEffect.layer == SpawnPool.miUIEffectLayer || oEffect.layer == SpawnPool.miModelLayer)
     {
         NcDuplicator componentInChildren = oEffect.GetComponentInChildren <NcDuplicator>();
         if (componentInChildren != null)
         {
             LogSystem.LogWarning(new object[]
             {
                 oEffect.name,
                 " NcDuplicator cannot be replayed."
             });
             return;
         }
         NcSpriteAnimation[] componentsInChildren = oEffect.GetComponentsInChildren <NcSpriteAnimation>(true);
         for (int i = 0; i < componentsInChildren.Length; i++)
         {
             if (componentsInChildren[i] != null)
             {
                 componentsInChildren[i].ResetAnimation();
             }
         }
         NcCurveAnimation[] componentsInChildren2 = oEffect.GetComponentsInChildren <NcCurveAnimation>(true);
         for (int j = 0; j < componentsInChildren2.Length; j++)
         {
             if (componentsInChildren2[j] != null)
             {
                 componentsInChildren2[j].ResetAnimation();
             }
         }
         NcDelayActive[] componentsInChildren3 = oEffect.GetComponentsInChildren <NcDelayActive>(true);
         for (int k = 0; k < componentsInChildren3.Length; k++)
         {
             if (componentsInChildren3[k] != null)
             {
                 componentsInChildren3[k].ResetAnimation();
             }
         }
         NcUvAnimation[] componentsInChildren4 = oEffect.GetComponentsInChildren <NcUvAnimation>(true);
         for (int l = 0; l < componentsInChildren4.Length; l++)
         {
             if (componentsInChildren4[l] != null)
             {
                 componentsInChildren4[l].ResetAnimation();
             }
         }
         ParticleSystem[] componentsInChildren5 = oEffect.GetComponentsInChildren <ParticleSystem>(true);
         for (int m = 0; m < componentsInChildren5.Length; m++)
         {
             ParticleSystem particleSystem = componentsInChildren5[m];
             if (particleSystem != null)
             {
                 particleSystem.Stop();
                 particleSystem.Clear();
                 particleSystem.time = 0f;
                 particleSystem.Play();
             }
         }
         Animation[] componentsInChildren6 = oEffect.GetComponentsInChildren <Animation>(true);
         for (int n = 0; n < componentsInChildren6.Length; n++)
         {
             Animation animation = componentsInChildren6[n];
             if (!(animation == null))
             {
                 foreach (AnimationState animationState in animation)
                 {
                     animationState.time = 0f;
                 }
                 animation.Play();
             }
         }
         DestroyForTime[] componentsInChildren7 = oEffect.GetComponentsInChildren <DestroyForTime>(true);
         for (int num = 0; num < componentsInChildren7.Length; num++)
         {
             DestroyForTime destroyForTime = componentsInChildren7[num];
             if (!(destroyForTime == null))
             {
                 destroyForTime.Reset();
             }
         }
     }
 }
Exemple #5
0
 public void ResetEffect()
 {
     if (!this.init)
     {
         this.Awake();
     }
     if (this.item != null)
     {
         LogSystem.LogWarning(new object[]
         {
             base.gameObject.name,
             " NcDuplicator cannot be replayed."
         });
         return;
     }
     if (this.list8 != null)
     {
         try
         {
             for (int i = 0; i < this.list8.Length; i++)
             {
                 DestroyForTime destroyForTime = this.list8[i];
                 if (!(destroyForTime == null))
                 {
                     destroyForTime.Reset();
                 }
             }
         }
         catch (Exception ex)
         {
             LogSystem.LogError(new object[]
             {
                 ex.ToString()
             });
         }
     }
     if (this.list1 != null)
     {
         try
         {
             for (int j = 0; j < this.list1.Length; j++)
             {
                 if (this.list1[j] != null)
                 {
                     this.list1[j].ResetAnimation();
                 }
             }
         }
         catch (Exception ex2)
         {
             LogSystem.LogError(new object[]
             {
                 ex2.ToString()
             });
         }
     }
     if (this.list2 != null)
     {
         try
         {
             for (int k = 0; k < this.list2.Length; k++)
             {
                 if (this.list2[k] != null)
                 {
                     this.list2[k].ResetAnimation();
                 }
             }
         }
         catch (Exception ex3)
         {
             LogSystem.LogError(new object[]
             {
                 ex3.ToString()
             });
         }
     }
     if (this.list3 != null)
     {
         try
         {
             for (int l = 0; l < this.list3.Length; l++)
             {
                 if (this.list3[l] != null)
                 {
                     this.list3[l].ResetAnimation();
                 }
             }
         }
         catch (Exception ex4)
         {
             LogSystem.LogError(new object[]
             {
                 ex4.ToString()
             });
         }
     }
     if (this.list4 != null)
     {
         try
         {
             for (int m = 0; m < this.list4.Length; m++)
             {
                 if (this.list4[m] != null)
                 {
                     this.list4[m].ResetAnimation();
                 }
             }
         }
         catch (Exception ex5)
         {
             LogSystem.LogError(new object[]
             {
                 ex5.ToString()
             });
         }
     }
     if (this.list5 != null)
     {
         try
         {
             for (int n = 0; n < this.list5.Length; n++)
             {
                 ParticleSystem particleSystem = this.list5[n];
                 if (particleSystem != null)
                 {
                     particleSystem.Stop();
                     particleSystem.Clear();
                     particleSystem.time = 0f;
                     particleSystem.Play();
                 }
             }
         }
         catch (Exception ex6)
         {
             LogSystem.LogError(new object[]
             {
                 ex6.ToString()
             });
         }
     }
     if (this.list6 != null)
     {
         try
         {
             for (int num = 0; num < this.list6.Length; num++)
             {
                 Animation animation = this.list6[num];
                 if (!(animation == null))
                 {
                     foreach (AnimationState animationState in animation)
                     {
                         animationState.time = 0f;
                     }
                     animation.Play();
                 }
             }
         }
         catch (Exception ex7)
         {
             LogSystem.LogError(new object[]
             {
                 ex7.ToString()
             });
         }
     }
 }