Ejemplo n.º 1
0
 public void StandRetreat(Vector3 retreatDir, float velocity)
 {
     retreatDir.y = 0f;
     if (this.IsActive())
     {
         if (this._retreatMode == RetreatMode.Retreat)
         {
             Vector3 vector  = (Vector3)(this._retreatDir * this._velocity);
             Vector3 vector2 = (Vector3)(retreatDir * velocity);
             Vector3 vector3 = vector + vector2;
             this._retreatDir.y = 0f;
             this._retreatDir   = vector3.normalized;
             this._velocity     = vector3.magnitude;
         }
         else
         {
             this.CancelActiveRetreat();
             this._retreatDir = retreatDir.normalized;
             this._velocity   = velocity;
         }
     }
     else
     {
         this._retreatDir = retreatDir.normalized;
         this._velocity   = velocity;
     }
     this._retreatMode = RetreatMode.Retreat;
     this.active       = true;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
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;
 }