public void TryPlaySE(AlwaysEffectParams alwaysEffect, AlwaysEffectState state)
 {
     if (alwaysEffect == null)
     {
         return;
     }
     if (state != AlwaysEffectState.In)
     {
         if (state != AlwaysEffectState.Always)
         {
             if (state == AlwaysEffectState.Out)
             {
                 this.TryPlaySE(alwaysEffect.outSeId, 0f, false);
                 this.TryStopSE(alwaysEffect.inSeId, 0f);
                 this.TryStopSE(alwaysEffect.alwaysSeId, 0f);
             }
         }
         else
         {
             this.TryPlaySE(alwaysEffect.alwaysSeId, 0f, true);
         }
     }
     else
     {
         this.TryPlaySE(alwaysEffect.inSeId, 0f, false);
         this.TryPlaySE(alwaysEffect.alwaysSeId, 0.1f, true);
     }
 }
Beispiel #2
0
 public void PlayAnimationTrigger(AlwaysEffectState effectState)
 {
     base.gameObject.SetActive(true);
     if (this._playAnimation != null)
     {
         base.StopCoroutine(this._playAnimation);
     }
     this._currentState  = effectState;
     this._playAnimation = this.PlayAnimation(effectState, null, 0f);
     base.StartCoroutine(this._playAnimation);
 }
 public void TryPlaySE(AlwaysEffectParams[] alwaysEffect, AlwaysEffectState state)
 {
     if (alwaysEffect == null)
     {
         return;
     }
     if (alwaysEffect.Length == 0)
     {
         return;
     }
     this.TryPlaySE(alwaysEffect[0], state);
 }
Beispiel #4
0
    private IEnumerator PlayAnimation(AlwaysEffectState effectState, Transform position = null, float distance = 0f)
    {
        this._isPlaying = true;
        Transform _position = base.transform;

        if (position != null)
        {
            _position = position;
        }
        if (effectState == AlwaysEffectState.In)
        {
            this.BillboardObjectInitializeInternal(_position, distance);
            this._effectAnimation.clip = this._inAnimationClip;
            this._effectAnimation.PlayQueued(this._effectAnimation.clip.name, QueueMode.PlayNow);
            this._effectAnimation.CrossFadeQueued(this._alwaysAnimationClip.name, 0.5f, QueueMode.CompleteOthers);
            this._onBillboard = true;
            yield break;
        }
        if (effectState != AlwaysEffectState.Always)
        {
            this._effectAnimation.clip = this._outAnimationClip;
            this._effectAnimation.CrossFadeQueued(this._effectAnimation.clip.name, 0.5f, QueueMode.PlayNow);
            this._onBillboard = true;
            while (this._effectAnimation.isPlaying)
            {
                yield return(null);
            }
            this._effectAnimation[this._effectAnimation.clip.name].normalizedTime = 1f;
            this._onBillboard = false;
            this._isPlaying   = false;
            yield break;
        }
        if (!this._effectAnimation.isPlaying || this._alwaysAnimationClip != this._effectAnimation.clip)
        {
            this.BillboardObjectInitializeInternal(_position, distance);
            this._effectAnimation.clip = this._alwaysAnimationClip;
            this._effectAnimation.PlayQueued(this._effectAnimation.clip.name, QueueMode.PlayNow);
            this._onBillboard = true;
        }
        yield break;
    }
Beispiel #5
0
 public void PlayAlwaysEffectAction(AlwaysEffectParams alwaysEffect, AlwaysEffectState state)
 {
     alwaysEffect.PlayAnimationTrigger(state);
 }
Beispiel #6
0
 public void SetState(AlwaysEffectState state)
 {
     this._nextState = state;
 }
Beispiel #7
0
 public void SetState(AlwaysEffectState state)
 {
     this._currentState = state;
 }