コード例 #1
0
 /* Movement */
 private void AnimationMovement()
 {
     _anime.SetFloat("DirectionX", newDirection.x);
     _anime.SetFloat("DirectionY", newDirection.y);
     _anime.SetBool("Moving", true);
     currentState = TestObjectState.walk;
 }
コード例 #2
0
    /* ************************************************ */
    /* 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;
    }
コード例 #3
0
 /* ************************************************ */
 /* Animations */
 /* ************************************************ */
 /* Idle */
 private void AnimationIdle()
 {
     _anime.SetBool("Moving", false);
     currentState = TestObjectState.idle;
 }