Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //using System.Numerics;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public abstract class PlayerState
- {
- protected Player player;
- protected Animator anim;
- protected Rigidbody2D rb;
- protected Combat combat;
- protected bool JumpPressed { get => player.jumpPressed; set => player.jumpPressed = value; }
- protected bool JumpReleased { get => player.jumpReleased; set => player.jumpReleased = value; }
- protected bool RunPressed => player.runPressed;
- protected bool AttackPressed => player.attackPressed;
- protected Vector2 MoveInput => player.moveInput;
- public PlayerState(Player player)
- {
- this.player = player;
- this.anim = player.anim;
- // this.rb = player.rb ?? player.GetComponent<Rigidbody2D>();
- this.rb = player.rb;
- combat = player.combat;
- }
- public virtual void Enter() { }
- public virtual void Exit() { }
- public virtual void Update() { }
- public virtual void FixedUpdate() { }
- public virtual void AttackAnimationFinished() { }
- }
Advertisement
Add Comment
Please, Sign In to add comment