Exemplo n.º 1
0
 public void BlowVelocityScaledRetreat(Vector3 retreatDir, float velocity, string namedState, float velocityScale)
 {
     if (this.active)
     {
         this.CancelActiveRetreat();
     }
     this._retreatMode        = RetreatMode.BlowVelocityScaled;
     this._retreatDir         = retreatDir;
     this._velocity           = velocity;
     this._namedRetreatName   = namedState;
     this._scaleVelocityScale = velocityScale;
     this._namedRetreatState  = NamedStateRetreatState.WaitingForState;
     this.active = true;
 }
Exemplo n.º 2
0
 public void BlowDecelerateRetreat(Vector3 retreatDir, float velocity, string namedState, float velocityRatio, float endNormalizedTime)
 {
     if (this.active)
     {
         this.CancelActiveRetreat();
     }
     this._retreatMode                 = RetreatMode.BlowDecelerated;
     this._retreatDir                  = retreatDir;
     this._decelerateInitVelocity      = this._velocity = velocity * velocityRatio;
     this._decelerateEndNormalizedTime = endNormalizedTime;
     this._namedRetreatName            = namedState;
     this._namedRetreatState           = NamedStateRetreatState.WaitingForState;
     this.active = true;
 }
Exemplo n.º 3
0
 private void BlowVelocityScaledRetreatCore()
 {
     if (this._namedRetreatState == NamedStateRetreatState.WaitingForState)
     {
         if (this._retreatEntity.GetCurrentNamedState() == this._namedRetreatName)
         {
             this._namedRetreatState    = NamedStateRetreatState.InState;
             this._scaleVelocityStackIx = this._retreatEntity.PushProperty("Animator_RigidBodyVelocityRatio", this._scaleVelocityScale);
         }
     }
     else if ((this._namedRetreatState == NamedStateRetreatState.InState) && (this._retreatEntity.GetCurrentNamedState() != this._namedRetreatName))
     {
         this._retreatEntity.PopProperty("Animator_RigidBodyVelocityRatio", this._scaleVelocityStackIx);
         this.active = false;
     }
 }
Exemplo n.º 4
0
 private void BlowDecelerateRetreatFixedCore()
 {
     if (this._namedRetreatState == NamedStateRetreatState.WaitingForState)
     {
         if (this._retreatEntity.GetCurrentNamedState() == this._namedRetreatName)
         {
             this._namedRetreatState = NamedStateRetreatState.InState;
         }
     }
     else if (this._namedRetreatState == NamedStateRetreatState.InState)
     {
         this._velocity = Mathf.Lerp(this._decelerateInitVelocity, 0f, Mathf.Clamp01(this._retreatEntity.GetCurrentNormalizedTime() / this._decelerateEndNormalizedTime));
         this._retreatEntity.SetNeedOverrideVelocity(true);
         this._retreatEntity.SetOverrideVelocity((Vector3)((this._velocity * this._retreatDir) * base._entity.TimeScale));
         if ((this._retreatEntity.GetCurrentNamedState() != this._namedRetreatName) || ((this._velocity >= -0.1f) && (this._velocity <= 0.1f)))
         {
             this._retreatEntity.SetNeedOverrideVelocity(false);
             this.active = false;
         }
     }
 }