protected override void LateUpdate() { if (!this.IsRunningParameter.IsNullOrWhiteSpace()) { this.Animator.SetBool(this.IsRunningParameter, this.Controller.IsOnGround && FlaiMath.Abs(this.Controller.Velocity.X) > 0.01f); } if (!this.IsOnGroundParameter.IsNullOrWhiteSpace()) { this.Animator.SetBool(this.IsOnGroundParameter, this.Controller.IsOnGround); } if (!this.HorizontalVelocity.IsNullOrWhiteSpace()) { this.Animator.SetFloat(this.HorizontalVelocity, this.Controller.Velocity.X); } if (!this.VerticalVelocity.IsNullOrWhiteSpace()) { this.Animator.SetFloat(this.VerticalVelocity, this.Controller.Velocity.Y); } }
protected virtual void SetGroundDirection() { int multiplier = (this.GroundDirection == VerticalDirection.Down) ? 1 : -1; this.Scale2D = new Vector2f(this.Scale2D.X, FlaiMath.Abs(this.Scale2D.Y) * multiplier); }