void Update() { //ApplyGravity(); //RotateCharacter(); MoveCharacter(); if (!myAnimator.GetCurrentAnimatorStateInfo(0).IsName("Idle") || !myAnimator.GetCurrentAnimatorStateInfo(0).IsName("Attack_Idle")) { // if(myAnimator.GetCurrentAnimatorStateInfo(0).length > 15f/60f & myAnimator.GetCurrentAnimatorStateInfo(0).length < 25f / 60f) if (move) { attackMovement.AttackForward(); } } dashF -= Time.deltaTime; if (dashF > 0) { attackMovement.Dash(); } if (Input.GetButtonDown("Jump")) { if (dashF < -(dashTime * 2)) { dashF = dashTime; } } if (Input.GetButtonDown("Fire1")) { if (myAnimator.GetCurrentAnimatorStateInfo(0).IsName("Idle")) { attackCombo = 0; attackCombo++; Attack(); } else if (myAnimator.GetCurrentAnimatorStateInfo(0).IsName("Attack_Idle")) { attackCombo = 0; attackCombo++; Attack(); } else { switch (attackCombo) { case 1: attackCombo++; ComboAttack(); break; default: attackCombo = 0; break; } } } }
void Update() { //ApplyGravity(); //RotateCharacter(); MoveCharacter(); if (!myAnimator.GetCurrentAnimatorStateInfo(0).IsName("Idle") || !myAnimator.GetCurrentAnimatorStateInfo(0).IsName("Attack_Idle")) { if (move) { attackMovement.AttackForward(); } } dashF -= Time.deltaTime; if (dashF > 0) { attackMovement.Dash(); } if (Input.GetButtonDown("Jump")) { if (dashF < -(dashTime * 2)) { dashF = dashTime; } } RunStates(); }