Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PlayerAttackState : PlayerState
- {
- public PlayerAttackState(Player player) : base(player) { }
- public override void Enter()
- {
- base.Enter();
- anim.SetBool("isAttacking", true);
- rb.linearVelocity = new Vector2(0f, rb.linearVelocity.y);
- }
- public override void AttackAnimationFinished()
- {
- if (Math.Abs(MoveInput.x) > 0.1f)
- player.ChangeState(player.moveState);
- else
- player.ChangeState(player.idleState);
- }
- public override void Exit()
- {
- base.Exit();
- anim.SetBool("isAttacking", false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment