Exemple #1
0
            internal void HandleStop(EffectEntity effectEntity, bool isDestroyed)
            {
                if (isDestroyed)
                {
                    if (effectEntity.State.IsPlaying())
                    {
                        activeEffects.Remove(effectEntity);
                    }
                    else if (effectEntity.State.IsIdle())
                    {
                        idleEffects.Remove(effectEntity);
                    }

                    effectEntity.Deinitialize();
                    GameObjectPool.Return(effectEntity, true);
                }
                else
                {
                    Assert.IsTrue(effectEntity.State.IsPlaying(), $"Stopped effect with invalid state: {effectEntity.State} at: {effectEntity.GetPath()}!");
                    if (effectEntity.State.IsPlaying())
                    {
                        activeEffects.Remove(effectEntity);
                        idleEffects.Add(effectEntity);
                    }

                    effectEntity.gameObject.SetActive(false);
                    effectEntity.transform.parent = reference.containerTransform;
                }
            }
Exemple #2
0
            private void AddEffect()
            {
                EffectEntity newEffect = GameObjectPool.Take(effectSettings.Prototype, Vector3.zero, Quaternion.identity, reference.containerTransform);

                newEffect.Initialize(effectSettings);
                idleEffects.Add(newEffect);

                newEffect.gameObject.SetActive(false);
            }
        public IEffectEntity PlayEffect(Vector3 position, Quaternion rotation, out long playId, Transform parent = null)
        {
            Assert.IsNotNull(EffectContainer, $"Effect {name} is not initialized and won't play!");

            if (EffectContainer != null)
            {
                EffectEntity newEffect = EffectContainer.Play(position, rotation, parent);
                playId = newEffect?.PlayId ?? -1;
                return(newEffect);
            }

            playId = -1;
            return(null);
        }
Exemple #4
0
 public void Replay()
 {
     EffectEntity.Replay(PlayId);
 }
Exemple #5
0
 public void Stop()
 {
     EffectEntity.Stop(PlayId);
 }
Exemple #6
0
 public void Fade()
 {
     EffectEntity.Fade(PlayId);
 }
Exemple #7
0
 internal void HandleFade(EffectEntity effectEntity)
 {
     effectEntity.transform.parent = reference.containerTransform;
 }
 internal void HandleFade(EffectEntity effectEntity)
 {
     EffectContainer.HandleFade(effectEntity);
 }
 internal void HandleStop(EffectEntity effectEntity, bool isDestroyed)
 {
     EffectContainer.HandleStop(effectEntity, isDestroyed);
 }