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();
        }
Exemplo n.º 3
0
        public void Loop()
        {
            if (isLooping || effectParams.IsNull())
            {
                return;
            }

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