Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum PlayerState
- {
- Idle = 0,
- Move,
- Attack,
- Skill
- }
- public class PlayerCharacter
- {
- private PlayerState m_State;
- private Skill m_Skill;
- private UpperBody m_Upper;
- private BottomBody m_Bottom;
- private void Update()
- {
- if ( Input.GetKeyDown(KeyCode.Space) == true )
- {
- m_State = PlayerState.Skill;
- m_Skill = Skill.Skill_1;
- }
- if ( Input.GetKeyDown(KeyCode.A) == true )
- {
- m_State = PlayerState.Skill;
- m_Skill = Skill.Skill_2;
- }
- FSM();
- }
- private void FSM()
- {
- switch ( m_State )
- {
- case PlayerState.Idle:
- break;
- case PlayerState.Attack:
- break;
- case PlayerState.Move:
- case PlayerState.Skill:
- {
- FSM_Skill();
- m_Upper.UseSkill();
- m_Bottom.Walk();
- }
- break;
- default:
- break;
- }
- }
- private void FSM_Skill()
- {
- switch ( m_Skill )
- {
- case Skill.No:
- break;
- case Skill.Skill_1:
- break;
- case Skill.Skill_2:
- break;
- case Skill.Skill_3:
- break;
- default:
- break;
- }
- }
- }
- public enum Skill
- {
- No = 0,
- Skill_1,
- Skill_2,
- Skill_3
- }
- public class UpperBody
- {
- private BottomBody m_Bottom;
- public void Control()
- {
- m_Bottom.Walk();
- }
- public void Rotate()
- {
- }
- public void UseSkill()
- {
- }
- }
- public class BottomBody
- {
- private UpperBody m_Upper;
- public void Control()
- {
- m_Upper.Rotate();
- }
- public void Walk()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement