public override int GetAnimationState()
 {
     if (this.m_bRepeat || !base.enabled || !NcEffectBehaviour.IsActive(base.gameObject) || !base.IsEndAnimation())
     {
     }
     return(-1);
 }
Exemplo n.º 2
0
 public override int GetAnimationState()
 {
     if (!base.enabled || !NcEffectBehaviour.IsActive(base.gameObject))
     {
         return(-1);
     }
     if (this.m_bBurst)
     {
         if (0 >= this.m_nBurstRepeatCount)
         {
             return(1);
         }
         if (this.m_nCreateCount < this.m_nBurstRepeatCount)
         {
             return(1);
         }
         return(0);
     }
     else
     {
         if (0f < this.m_fStartDelayTime)
         {
             return(1);
         }
         if (0f >= this.m_fEmitTime || this.m_fSleepTime > 0f)
         {
             return(-1);
         }
         if (this.m_nCreateCount < 1)
         {
             return(1);
         }
         return(0);
     }
 }
Exemplo n.º 3
0
 public override int GetAnimationState()
 {
     if ((base.enabled && NcEffectBehaviour.IsActive(base.gameObject)) || (this.m_AudioSource != null && this.m_AudioSource.isPlaying))
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 4
0
 public override int GetAnimationState()
 {
     if ((base.enabled && NcEffectBehaviour.IsActive(base.gameObject)) || (this.m_AudioSource != null && (this.m_AudioSource.isPlaying || NcEffectBehaviour.GetEngineTime() < this.m_fStartTime + this.m_fDelayTime)))
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 5
0
 public override int GetAnimationState()
 {
     if (base.enabled && NcEffectBehaviour.IsActive(base.gameObject) && (this.m_nDuplicateCount == 0 || (this.m_nDuplicateCount != 0 && this.m_nCreateCount < this.m_nDuplicateCount)))
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 6
0
 public override int GetAnimationState()
 {
     if (!this.m_bRepeat)
     {
         if (!base.get_enabled() || !NcEffectBehaviour.IsActive(base.get_gameObject()) || !base.IsEndAnimation())
         {
         }
     }
     return(-1);
 }
Exemplo n.º 7
0
 public void SetChangeTime(float fDelayTime, float fChangeTime, float fFromAlphaValue, float fToAlphaValue)
 {
     this.m_fDelayTime      = fDelayTime;
     this.m_fChangeTime     = fChangeTime;
     this.m_fFromAlphaValue = fFromAlphaValue;
     this.m_fToMeshValue    = fToAlphaValue;
     if (NcEffectBehaviour.IsActive(base.gameObject))
     {
         this.Start();
         this.Update();
     }
 }
Exemplo n.º 8
0
 public override int GetAnimationState()
 {
     if (!base.enabled || !NcEffectBehaviour.IsActive(base.gameObject))
     {
         return(-1);
     }
     if (0f < this.m_fDurationTime && (this.m_fStartTime == 0f || !base.IsEndAnimation()))
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 9
0
 public override int GetAnimationState()
 {
     if (!base.enabled || !NcEffectBehaviour.IsActive(base.gameObject))
     {
         return(-1);
     }
     if (NcEffectBehaviour.GetEngineTime() < this.m_fStartTime + this.m_fDelayTime + 0.1f)
     {
         return(1);
     }
     return(-1);
 }
Exemplo n.º 10
0
 public override int GetAnimationState()
 {
     if (!base.get_enabled() || !NcEffectBehaviour.IsActive(base.get_gameObject()))
     {
         return(-1);
     }
     if (this.m_fStartTime == 0f || !base.IsEndAnimation())
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 11
0
 public override int GetAnimationState()
 {
     if (!this.m_enabled || !NcEffectBehaviour.IsActive(base.gameObject))
     {
         return(-1);
     }
     if ((this.m_fStartTime != 0f) && base.IsEndAnimation())
     {
         return(0);
     }
     return(1);
 }
Exemplo n.º 12
0
 public override int GetAnimationState()
 {
     if (!this.m_bRepeat)
     {
         int num;
         if ((base.enabled && NcEffectBehaviour.IsActive(base.gameObject)) && !base.IsEndAnimation())
         {
             num = 1;
         }
         num = 0;
     }
     return(-1);
 }
Exemplo n.º 13
0
    public static NcAutoDestruct CreateAutoDestruct(GameObject baseGameObject, float fLifeTime, float fDestroyTime, bool bSmoothHide)
    {
        NcAutoDestruct ncAutoDestruct = baseGameObject.AddComponent <NcAutoDestruct>();

        ncAutoDestruct.m_fLifeTime          = fLifeTime;
        ncAutoDestruct.m_fSmoothDestroyTime = fDestroyTime;
        ncAutoDestruct.m_bSmoothHide        = bSmoothHide;
        if (NcEffectBehaviour.IsActive(baseGameObject))
        {
            ncAutoDestruct.Start();
            ncAutoDestruct.Update();
        }
        return(ncAutoDestruct);
    }
Exemplo n.º 14
0
 public override int GetAnimationState()
 {
     if (base.get_enabled() && NcEffectBehaviour.IsActive(base.get_gameObject()) && this.m_AttachPrefab != null)
     {
         if (this.m_AttachType == NcAttachPrefab.AttachType.Active && ((this.m_nRepeatCount == 0 && this.m_nCreateCount < 1) || (0f < this.m_fRepeatTime && this.m_nRepeatCount == 0) || (0 < this.m_nRepeatCount && this.m_nCreateCount < this.m_nRepeatCount)))
         {
             return(1);
         }
         if (this.m_AttachType == NcAttachPrefab.AttachType.Destroy)
         {
             return(1);
         }
     }
     return(0);
 }
Exemplo n.º 15
0
 private void Awake()
 {
     this.m_nCreateCount = 0;
     this.m_fStartTime   = -this.m_fDuplicateTime;
     this.m_ClonObject   = null;
     this.m_bInvoke      = false;
     if (!base.enabled)
     {
         return;
     }
     if (base.transform.parent != null && base.enabled && NcEffectBehaviour.IsActive(base.gameObject) && base.GetComponent <NcDontActive>() == null)
     {
         this.InitCloneObject();
     }
 }
Exemplo n.º 16
0
 private void Awake()
 {
     this.m_bEnabled = (base.get_enabled() && NcEffectBehaviour.IsActive(base.get_gameObject()) && base.GetComponent <NcDontActive>() == null);
 }
Exemplo n.º 17
0
 protected virtual void Awake()
 {
     this.m_bEnabled = (base.enabled && NcEffectBehaviour.IsActive(base.gameObject) && base.GetComponent <NcDontActive>() == null);
 }
Exemplo n.º 18
0
 private void Update()
 {
     if (!this.m_bStartDetach)
     {
         this.m_bStartDetach = true;
         if (base.transform.parent != null)
         {
             this.m_ParentGameObject = base.transform.parent.gameObject;
             this.m_ncDetachObject   = NcDetachObject.Create(this.m_ParentGameObject, base.transform.gameObject);
         }
         GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();
         if (this.m_bFollowParentTransform)
         {
             this.m_OriginalPos.SetLocalTransform(base.transform);
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
             this.m_OriginalPos.CopyToLocalTransform(base.transform);
         }
         else
         {
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
         }
         if (!this.m_bParentHideToStartDestroy)
         {
             this.StartDestroy();
         }
     }
     if (0f < this.m_fStartDestroyTime)
     {
         if (0f < this.m_fSmoothDestroyTime)
         {
             if (this.m_bSmoothHide)
             {
                 float num = 1f - (NcEffectBehaviour.GetEngineTime() - this.m_fStartDestroyTime) / this.m_fSmoothDestroyTime;
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 if (this.m_bMeshFilterOnlySmoothHide)
                 {
                     MeshFilter[] componentsInChildren = base.transform.GetComponentsInChildren <MeshFilter>(true);
                     for (int i = 0; i < componentsInChildren.Length; i++)
                     {
                         Color[] array = componentsInChildren[i].mesh.colors;
                         if (array.Length == 0)
                         {
                             array = new Color[componentsInChildren[i].mesh.vertices.Length];
                             for (int j = 0; j < array.Length; j++)
                             {
                                 array[j] = Color.white;
                             }
                         }
                         for (int k = 0; k < array.Length; k++)
                         {
                             Color color = array[k];
                             color.a  = Mathf.Min(color.a, num);
                             array[k] = color;
                         }
                         componentsInChildren[i].mesh.colors = array;
                     }
                 }
                 else
                 {
                     Renderer[] componentsInChildren2 = base.transform.GetComponentsInChildren <Renderer>(true);
                     for (int l = 0; l < componentsInChildren2.Length; l++)
                     {
                         Renderer renderer          = componentsInChildren2[l];
                         string   materialColorName = NcEffectBehaviour.GetMaterialColorName(renderer.sharedMaterial);
                         if (materialColorName != null)
                         {
                             Color color2 = renderer.material.GetColor(materialColorName);
                             color2.a = Mathf.Min(color2.a, num);
                             renderer.material.SetColor(materialColorName, color2);
                         }
                     }
                 }
             }
             if (this.m_fStartDestroyTime + this.m_fSmoothDestroyTime < NcEffectBehaviour.GetEngineTime())
             {
                 UnityEngine.Object.Destroy(base.gameObject);
             }
         }
     }
     else if (this.m_bParentHideToStartDestroy && (this.m_ParentGameObject == null || !NcEffectBehaviour.IsActive(this.m_ParentGameObject)))
     {
         this.StartDestroy();
     }
     if (this.m_bFollowParentTransform && this.m_ParentGameObject != null && this.m_ParentGameObject.transform != null)
     {
         NcTransformTool ncTransformTool = new NcTransformTool();
         ncTransformTool.SetTransform(this.m_OriginalPos);
         ncTransformTool.AddTransform(this.m_ParentGameObject.transform);
         ncTransformTool.CopyToLocalTransform(base.transform);
     }
 }
Exemplo n.º 19
0
 private void Update()
 {
     if (!this.m_bStartDetach)
     {
         this.m_bStartDetach = true;
         if (base.transform.parent != null)
         {
             this.m_ParentGameObject = base.transform.parent.gameObject;
             NcDetachObject.Create(this.m_ParentGameObject, base.transform.gameObject);
         }
         GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();
         if (this.m_bFollowParentTransform)
         {
             this.m_OriginalPos.SetLocalTransform(base.transform);
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
             this.m_OriginalPos.CopyToLocalTransform(base.transform);
         }
         else
         {
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
         }
         if (!this.m_bParentHideToStartDestroy)
         {
             this.StartDestroy();
         }
     }
     if (0f < this.m_fStartDestroyTime)
     {
         if (0f < this.m_fSmoothDestroyTime)
         {
             if (this.m_bSmoothHide)
             {
                 float num = 1f - (NcEffectBehaviour.GetEngineTime() - this.m_fStartDestroyTime) / this.m_fSmoothDestroyTime;
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 Renderer[] componentsInChildren = base.transform.GetComponentsInChildren <Renderer>(true);
                 for (int i = 0; i < componentsInChildren.Length; i++)
                 {
                     Renderer renderer          = componentsInChildren[i];
                     string   materialColorName = NcEffectBehaviour.GetMaterialColorName(renderer.material);
                     if (materialColorName != null)
                     {
                         Color color = renderer.material.GetColor(materialColorName);
                         color.a = Mathf.Min(num, color.a);
                         renderer.material.SetColor(materialColorName, color);
                     }
                 }
             }
             if (this.m_fStartDestroyTime + this.m_fSmoothDestroyTime < NcEffectBehaviour.GetEngineTime())
             {
                 DelegateProxy.GameDestory(base.gameObject);
             }
         }
     }
     else if (this.m_bParentHideToStartDestroy && (this.m_ParentGameObject == null || !NcEffectBehaviour.IsActive(this.m_ParentGameObject)))
     {
         this.StartDestroy();
     }
     if (this.m_bFollowParentTransform && this.m_ParentGameObject != null && this.m_ParentGameObject.transform != null)
     {
         NcTransformTool ncTransformTool = new NcTransformTool();
         ncTransformTool.SetTransform(this.m_OriginalPos);
         ncTransformTool.AddTransform(this.m_ParentGameObject.transform);
         ncTransformTool.CopyToLocalTransform(base.transform);
     }
 }
Exemplo n.º 20
0
 private void Update()
 {
     if (!this.m_bStartDetach)
     {
         this.m_bStartDetach = true;
         if (base.get_transform().get_parent() != null)
         {
             this.m_ParentGameObject = base.get_transform().get_parent().get_gameObject();
             NcDetachObject.Create(this.m_ParentGameObject, base.get_transform().get_gameObject());
         }
         GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();
         if (this.m_bFollowParentTransform)
         {
             this.m_OriginalPos.SetLocalTransform(base.get_transform());
             base.ChangeParent(rootInstanceEffect.get_transform(), base.get_transform(), false, null);
             this.m_OriginalPos.CopyToLocalTransform(base.get_transform());
         }
         else
         {
             base.ChangeParent(rootInstanceEffect.get_transform(), base.get_transform(), false, null);
         }
         if (!this.m_bParentHideToStartDestroy)
         {
             this.StartDestroy();
         }
     }
     if (0f < this.m_fStartDestroyTime)
     {
         if (0f < this.m_fSmoothDestroyTime)
         {
             if (this.m_bSmoothHide)
             {
                 float num = 1f - (NcEffectBehaviour.GetEngineTime() - this.m_fStartDestroyTime) / this.m_fSmoothDestroyTime;
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 if (this.m_bMeshFilterOnlySmoothHide)
                 {
                     MeshFilter[] componentsInChildren = base.get_transform().GetComponentsInChildren <MeshFilter>(true);
                     for (int i = 0; i < componentsInChildren.Length; i++)
                     {
                         Color[] colors = componentsInChildren[i].get_mesh().get_colors();
                         for (int j = 0; j < colors.Length; j++)
                         {
                             Color color = colors[j];
                             color.a  -= num;
                             colors[j] = color;
                         }
                         componentsInChildren[i].get_mesh().set_colors(colors);
                     }
                 }
                 else
                 {
                     Renderer[] componentsInChildren2 = base.get_transform().GetComponentsInChildren <Renderer>(true);
                     for (int k = 0; k < componentsInChildren2.Length; k++)
                     {
                         Renderer renderer          = componentsInChildren2[k];
                         string   materialColorName = NcEffectBehaviour.GetMaterialColorName(renderer.get_material());
                         if (materialColorName != null)
                         {
                             Color color2 = renderer.get_material().GetColor(materialColorName);
                             color2.a -= num;
                             renderer.get_material().SetColor(materialColorName, color2);
                         }
                     }
                 }
             }
             if (this.m_fStartDestroyTime + this.m_fSmoothDestroyTime < NcEffectBehaviour.GetEngineTime())
             {
                 Object.Destroy(base.get_gameObject());
             }
         }
     }
     else if (this.m_bParentHideToStartDestroy && (this.m_ParentGameObject == null || !NcEffectBehaviour.IsActive(this.m_ParentGameObject)))
     {
         this.StartDestroy();
     }
     if (this.m_bFollowParentTransform && this.m_ParentGameObject != null && this.m_ParentGameObject.get_transform() != null)
     {
         NcTransformTool ncTransformTool = new NcTransformTool();
         ncTransformTool.SetTransform(this.m_OriginalPos);
         ncTransformTool.AddTransform(this.m_ParentGameObject.get_transform());
         ncTransformTool.CopyToLocalTransform(base.get_transform());
     }
 }