/* Movement */ private void AnimationMovement() { _anime.SetFloat("DirectionX", newDirection.x); _anime.SetFloat("DirectionY", newDirection.y); _anime.SetBool("Moving", true); currentState = TestObjectState.walk; }
/* ************************************************ */ /* Main functions */ /* ************************************************ */ void Start() { currentState = TestObjectState.idle; _parent = transform.parent.gameObject; _anime = _parent.GetComponent <Animator>(); _rb2d = _parent.GetComponent <Rigidbody2D>(); MaxSpeedTemp = MaxSpeed; accelerationTemp = acceleration; /* Decceleration in [0,1] */ if (decceleration > 1) { decceleration = 1; } if (decceleration < 0) { decceleration = 0; } deccelerationTemp = decceleration; IsDashing = false; }
/* ************************************************ */ /* Animations */ /* ************************************************ */ /* Idle */ private void AnimationIdle() { _anime.SetBool("Moving", false); currentState = TestObjectState.idle; }