public override void Loop()
        {
            if (isPlaying || factory.IsNull())
            {
                return;
            }

            if (!factory.ParticleFactory.IsNull())
            {
                if (!psObj)
                {
                    psObj = factory.ParticleFactory.Create(xform);
                    PoolManager.SetOnDespawnedCallback(psObj.transform, OnParticleObjectDespawned);
                }

                psObj.Loop();
            }

            if (!factory.SoundFactory.IsNull())
            {
                if (!sndObj)
                {
                    sndObj = factory.SoundFactory.Create(xform);
                    PoolManager.SetOnDespawnedCallback(sndObj.transform, OnSoundObjectDespawned);
                }

                sndObj.Loop();
            }

            isPlaying = true;
        }
        void OnEnable()
        {
            if (!EffectParams.IsNull())
            {
                effectObj = EffectParams.Create(transform);
            }

            effectObj.Loop();
        }
        private void OnSoundObjectDespawned()
        {
            sndObj = null;

            if (psObj == null)
            {
                DespawnSelf();
            }
        }
        private void OnParticleObjectDespawned()
        {
            psObj = null;

            if (sndObj == null)
            {
                DespawnSelf();
            }
        }
Esempio n. 5
0
        public void SmoothStop()
        {
            if (effectObj)
            {
                effectObj.SmoothDestroy();
            }

            effectObj = null;
            isLooping = false;
        }
Esempio n. 6
0
        public void Loop()
        {
            if (isLooping || effectParams.IsNull())
            {
                return;
            }

            effectObj = effectParams.Create(transform);
            effectObj.Loop();
            isLooping = true;
        }