Пример #1
0
        private void Update()
        {
            if (string.IsNullOrEmpty(m_AssetName) || m_AssetName == "None")
            {
                RecycleFX();
                return;
            }

            if (m_VFXController != null)
            {
                m_VFXController.OnUpdate(Time.deltaTime);

                if (m_Status == EffectStatus.Playing)
                {
                    if (m_VFXController.AutoStop && Time.time > m_StartTime + m_VFXController.StopDelay * m_LifetimeScale)
                    {
                        StopAndRecycleFX();
                    }
                }

                if (m_Status == EffectStatus.Stop)
                {
                    if (++m_UpdateIntervalCounter % UPDATE_INTERVAL == 0)
                    {
                        if (m_AutoDestroyWhenNotExistLivingParticles &&
                            !m_VFXController.HaveLivingParticles())
                        {
                            RecycleFX();
                        }
                    }
                }
            }
        }