DEG-60 [FEAT] Editor 추가 등
This commit is contained in:
parent
2d9c6633b5
commit
9fc6f23f81
BIN
Assets/JAY/Animator/PlayerController.controller
(Stored with Git LFS)
BIN
Assets/JAY/Animator/PlayerController.controller
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/JAY/HousingUI.unity
(Stored with Git LFS)
BIN
Assets/JAY/HousingUI.unity
(Stored with Git LFS)
Binary file not shown.
@ -3,7 +3,7 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public enum PlayerState { None, Idle, Move, Hit, Dead }
|
public enum PlayerState { None, Idle, Move, Win, Hit, Dead }
|
||||||
|
|
||||||
public class PlayerController : CharacterBase, IObserver<GameObject>
|
public class PlayerController : CharacterBase, IObserver<GameObject>
|
||||||
{
|
{
|
||||||
@ -24,6 +24,8 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
// 상태 관련
|
// 상태 관련
|
||||||
private PlayerStateIdle _playerStateIdle;
|
private PlayerStateIdle _playerStateIdle;
|
||||||
private PlayerStateMove _playerStateMove;
|
private PlayerStateMove _playerStateMove;
|
||||||
|
private PlayerStateWin _playerStateWin;
|
||||||
|
private PlayerStateDead _playerStateDead;
|
||||||
|
|
||||||
// 행동 관련
|
// 행동 관련
|
||||||
private PlayerActionAttack _attackAction;
|
private PlayerActionAttack _attackAction;
|
||||||
@ -53,11 +55,15 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
// 상태 초기화
|
// 상태 초기화
|
||||||
_playerStateIdle = new PlayerStateIdle();
|
_playerStateIdle = new PlayerStateIdle();
|
||||||
_playerStateMove = new PlayerStateMove();
|
_playerStateMove = new PlayerStateMove();
|
||||||
|
_playerStateWin = new PlayerStateWin();
|
||||||
|
_playerStateDead = new PlayerStateDead();
|
||||||
|
|
||||||
_playerStates = new Dictionary<PlayerState, IPlayerState>
|
_playerStates = new Dictionary<PlayerState, IPlayerState>
|
||||||
{
|
{
|
||||||
{ PlayerState.Idle, _playerStateIdle },
|
{ PlayerState.Idle, _playerStateIdle },
|
||||||
{ PlayerState.Move, _playerStateMove },
|
{ PlayerState.Move, _playerStateMove },
|
||||||
|
{ PlayerState.Win, _playerStateWin },
|
||||||
|
{ PlayerState.Dead, _playerStateDead },
|
||||||
};
|
};
|
||||||
|
|
||||||
_attackAction = new PlayerActionAttack();
|
_attackAction = new PlayerActionAttack();
|
||||||
@ -201,8 +207,6 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
|
|
||||||
public void OnNext(GameObject value)
|
public void OnNext(GameObject value)
|
||||||
{
|
{
|
||||||
Debug.Log("무기 타격");
|
|
||||||
float playerAttackPower = _weaponController.AttackPower * attackPower; // 플레이어 공격 데미지(막타는 일반 데미지의 4배)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnError(Exception error)
|
public void OnError(Exception error)
|
||||||
@ -215,4 +219,5 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,12 @@ public class PlayerControllerEditor : Editor
|
|||||||
|
|
||||||
if (GUILayout.Button("BattleMode"))
|
if (GUILayout.Button("BattleMode"))
|
||||||
playerController.SwitchBattleMode();
|
playerController.SwitchBattleMode();
|
||||||
|
if (GUILayout.Button("Win"))
|
||||||
|
playerController.SetState(PlayerState.Win);
|
||||||
// if (GUILayout.Button("Hit"))
|
// if (GUILayout.Button("Hit"))
|
||||||
// playerController.SetState(PlayerState.Hit);
|
// playerController.SetState(PlayerState.Hit);
|
||||||
// if (GUILayout.Button("Dead"))
|
if (GUILayout.Button("Dead"))
|
||||||
// playerController.SetState(PlayerState.Dead);
|
playerController.SetState(PlayerState.Dead);
|
||||||
|
|
||||||
EditorGUILayout.EndHorizontal();
|
EditorGUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user