Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update()
- {
- //is the player in interact
- if (currentState == PlayerState.interact)
- {
- return; //just return if we are in interact
- }
- change = Vector3.zero;
- change.x = Input.GetAxisRaw("Horizontal");
- change.y = Input.GetAxisRaw("Vertical");
- if (Input.GetButtonDown("attack") && currentState != PlayerState.attack
- && currentState != PlayerState.stagger)
- {
- Debug.Log("Attack!");
- StartCoroutine(AttackCo());
- }
- else if (Input.GetButtonDown("Second Weapon") && currentState != PlayerState.attack
- && currentState != PlayerState.stagger)
- {
- StartCoroutine(SecondAttackCo());
- }
- }
- private void FixedUpdate()
- {
- if(currentState == PlayerState.walk || currentState == PlayerState.idle)
- {
- UpdateAnimationAndMove();
- }
- }
Add Comment
Please, Sign In to add comment