DEG-16 [UPDATE] UI에 플레이어 조작 연동

This commit is contained in:
Jay 2025-04-18 13:39:03 +09:00
parent 8d171983a1
commit d7fef392ae
8 changed files with 16 additions and 10 deletions

BIN
Assets/JAY/HousingUI.unity (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4ec2c7383c46ec645b868688b4e2950f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -25,7 +25,7 @@ public class PlayerController : CharacterBase
private PlayerStateMove _playerStateMove; private PlayerStateMove _playerStateMove;
// 외부에서도 사용하는 변수 // 외부에서도 사용하는 변수
public VariableJoystick joystick { get; private set; } public FixedJoystick joystick { get; private set; }
public PlayerState CurrentState { get; private set; } public PlayerState CurrentState { get; private set; }
private Dictionary<PlayerState, IPlayerState> _playerStates; private Dictionary<PlayerState, IPlayerState> _playerStates;
public Animator PlayerAnimator { get; private set; } public Animator PlayerAnimator { get; private set; }
@ -37,7 +37,7 @@ public class PlayerController : CharacterBase
_characterController = GetComponent<CharacterController>(); _characterController = GetComponent<CharacterController>();
if (joystick == null) if (joystick == null)
{ {
joystick = FindObjectOfType<VariableJoystick>(); joystick = FindObjectOfType<FixedJoystick>();
} }
} }

View File

@ -29,18 +29,14 @@ public class PlayerControllerEditor : Editor
// 지면 접촉 상태 // 지면 접촉 상태
GUI.backgroundColor = Color.white; GUI.backgroundColor = Color.white;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("캐릭터 위치 디버그 정보", EditorStyles.boldLabel); EditorGUILayout.LabelField("캐릭터 디버그 정보", EditorStyles.boldLabel);
// GUI.enabled = false; // GUI.enabled = false;
// EditorGUILayout.Toggle("지면 접촉", playerController.IsGrounded); // EditorGUILayout.Toggle("지면 접촉", playerController.IsGrounded);
// GUI.enabled = true; // GUI.enabled = true;
// 강제로 상태 변경 버튼 // 강제로 상태 변경 버튼
EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Idle"))
playerController.SetState(PlayerState.Idle);
if (GUILayout.Button("Move"))
playerController.SetState(PlayerState.Move);
if (GUILayout.Button("BattleMode")) if (GUILayout.Button("BattleMode"))
playerController.SwitchBattleMode(); playerController.SwitchBattleMode();
// if (GUILayout.Button("Attack")) // if (GUILayout.Button("Attack"))

View File

@ -1,6 +1,6 @@
using UnityEngine; using UnityEngine;
public class PlayerStateIdle : MonoBehaviour, IPlayerState public class PlayerStateIdle : IPlayerState
{ {
private PlayerController _playerController; private PlayerController _playerController;

View File

@ -1,6 +1,6 @@
using UnityEngine; using UnityEngine;
public class PlayerStateMove : MonoBehaviour, IPlayerState public class PlayerStateMove : IPlayerState
{ {
private static readonly int Move = Animator.StringToHash("Move"); private static readonly int Move = Animator.StringToHash("Move");
private PlayerController _playerController; private PlayerController _playerController;