Merge pull request #23 from Degulleo/DEG-60-플레이어-승리-구현

Deg 60 플레이어 승리 구현
This commit is contained in:
Jay 2025-04-24 18:02:19 +09:00 committed by GitHub
commit 5e61ff03c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 205 additions and 9 deletions

BIN
Assets/JAY/Animation/Dead.anim (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 26572f377ac934546b30d6d9e0cab051
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,109 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!319 &31900000
AvatarMask:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WholeBody
m_Mask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
m_Elements:
- m_Path:
m_Weight: 1
- m_Path: Body05
m_Weight: 1
- m_Path: Eye01
m_Weight: 1
- m_Path: Hair01
m_Weight: 1
- m_Path: Head01_Male
m_Weight: 1
- m_Path: Mouth01
m_Weight: 1
- m_Path: root
m_Weight: 1
- m_Path: root/pelvis
m_Weight: 1
- m_Path: root/pelvis/spine_01
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/BackpackBone
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/shoulderPadJoint_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/index_01_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/index_01_l/index_02_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/index_01_l/index_02_l/index_03_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/thumb_01_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/thumb_01_l/thumb_02_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/thumb_01_l/thumb_02_l/thumb_03_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_l/upperarm_l/lowerarm_l/hand_l/weapon_l
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/shoulderPadJoint_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/index_01_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/index_01_r/index_02_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/index_01_r/index_02_r/index_03_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/thumb_01_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/thumb_01_r/thumb_02_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/thumb_01_r/thumb_02_r/thumb_03_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/clavicle_r/upperarm_r/lowerarm_r/hand_r/weapon_r
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/CloakBone01
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/CloakBone01/CloakBone02
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/CloakBone01/CloakBone02/CloakBone03
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/neck_01
m_Weight: 1
- m_Path: root/pelvis/spine_01/spine_02/spine_03/neck_01/head
m_Weight: 1
- m_Path: root/pelvis/thigh_l
m_Weight: 1
- m_Path: root/pelvis/thigh_l/calf_l
m_Weight: 1
- m_Path: root/pelvis/thigh_l/calf_l/foot_l
m_Weight: 1
- m_Path: root/pelvis/thigh_l/calf_l/foot_l/ball_l
m_Weight: 1
- m_Path: root/pelvis/thigh_r
m_Weight: 1
- m_Path: root/pelvis/thigh_r/calf_r
m_Weight: 1
- m_Path: root/pelvis/thigh_r/calf_r/foot_r
m_Weight: 1
- m_Path: root/pelvis/thigh_r/calf_r/foot_r/ball_r
m_Weight: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6593ee38fd371db459652c920630d2c9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 31900000
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/JAY/Animation/Win.anim (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a3b0144fdb439d941b9e9014a1635178
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

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

Binary file not shown.

View File

@ -3,7 +3,7 @@ using System.Collections;
using System.Collections.Generic;
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>
{
@ -24,6 +24,8 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
// 상태 관련
private PlayerStateIdle _playerStateIdle;
private PlayerStateMove _playerStateMove;
private PlayerStateWin _playerStateWin;
private PlayerStateDead _playerStateDead;
// 행동 관련
private PlayerActionAttack _attackAction;
@ -53,11 +55,15 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
// 상태 초기화
_playerStateIdle = new PlayerStateIdle();
_playerStateMove = new PlayerStateMove();
_playerStateWin = new PlayerStateWin();
_playerStateDead = new PlayerStateDead();
_playerStates = new Dictionary<PlayerState, IPlayerState>
{
{ PlayerState.Idle, _playerStateIdle },
{ PlayerState.Move, _playerStateMove },
{ PlayerState.Win, _playerStateWin },
{ PlayerState.Dead, _playerStateDead },
};
_attackAction = new PlayerActionAttack();
@ -201,8 +207,6 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
public void OnNext(GameObject value)
{
Debug.Log("무기 타격");
float playerAttackPower = _weaponController.AttackPower * attackPower; // 플레이어 공격 데미지(막타는 일반 데미지의 4배)
}
public void OnError(Exception error)
@ -215,4 +219,5 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
}
#endregion
}

View File

@ -39,10 +39,12 @@ public class PlayerControllerEditor : Editor
if (GUILayout.Button("BattleMode"))
playerController.SwitchBattleMode();
if (GUILayout.Button("Win"))
playerController.SetState(PlayerState.Win);
// if (GUILayout.Button("Hit"))
// playerController.SetState(PlayerState.Hit);
// if (GUILayout.Button("Dead"))
// playerController.SetState(PlayerState.Dead);
if (GUILayout.Button("Dead"))
playerController.SetState(PlayerState.Dead);
EditorGUILayout.EndHorizontal();
}

View File

@ -0,0 +1,22 @@
using UnityEngine;
public class PlayerStateDead : IPlayerState
{
private PlayerController _playerController;
public void Enter(PlayerController playerController)
{
_playerController = playerController;
_playerController.PlayerAnimator.SetBool("Dead", true);
}
public void Update()
{
}
public void Exit()
{
_playerController.PlayerAnimator.SetBool("Dead", false);
_playerController = null;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b6fc619c4dc14ad98c56d083a62b56b7
timeCreated: 1745481194

View File

@ -0,0 +1,22 @@
using UnityEngine;
public class PlayerStateWin : IPlayerState
{
private PlayerController _playerController;
public void Enter(PlayerController playerController)
{
_playerController = playerController;
_playerController.PlayerAnimator.SetBool("Win", true);
}
public void Update()
{
}
public void Exit()
{
_playerController.PlayerAnimator.SetBool("Win", false);
_playerController = null;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e54b8d32431d4263a6a470f9a150b003
timeCreated: 1745479273