Ejemplo n.º 1
0
        // private float timeLastFrame;

        void Start()
        {
            // timeLastFrame = Time.realtimeSinceStartup;
            realDeltaTime = Time.deltaTime;
            DelayParticleSystems.Sort(Sort);
            DelayDestroyGameObject.Sort(Sort);
            if (DelayParticleSystems != null && DelayParticleSystems.Count > 0)
            {
                for (int i = 0; i < DelayParticleSystems.Count; i++)
                {
                    DelayParticleSystem dps = DelayParticleSystems[i];
                    dps.go.SetActive(false);
                }
                StartCoroutine(UpdateSelf());
            }

            if (DelayDestroyGameObject != null && DelayDestroyGameObject.Count > 0)
            {
                StartCoroutine(UpdateDestroyList());
            }

            if (m_destroyTime > 0)
            {
                StartCoroutine(UpdateDestroy());
            }
            //if (m_blIgnoreScaleTime)
            //{
            //    foreach (Animator ani in m_listAnimator)
            //    {
            //        ani.updateMode = AnimatorUpdateMode.UnscaledTime;
            //    }
            //}
        }
Ejemplo n.º 2
0
 IEnumerator UpdateSelf()
 {
     if (DelayParticleSystems != null)
     {
         for (int i = 0; i < DelayParticleSystems.Count; i++)
         {
             DelayParticleSystem dps = DelayParticleSystems[i];
             while (_currentTime < dps.delayTime)
             {
                 yield return(0);
             }
             dps.go.SetActive(true);
         }
     }
 }
Ejemplo n.º 3
0
 IEnumerator UpdateDestroyList()
 {
     if (DelayDestroyGameObject != null)
     {
         for (int i = 0; i < DelayDestroyGameObject.Count; i++)
         {
             DelayParticleSystem dps = DelayDestroyGameObject[i];
             while (_currentTime < dps.delayTime)
             {
                 yield return(0);
             }
             if (dps != null)
             {
                 dps.go.SetActive(false);
             }
         }
     }
 }
Ejemplo n.º 4
0
 public int Sort(DelayParticleSystem p1, DelayParticleSystem p2)
 {
     return(p1.delayTime <= p2.delayTime?-1:1);
 }