Genesis Game Client Project Setup
This commit is contained in:
8
Assets/02_Scripts/_Shared/Combat.meta
Normal file
8
Assets/02_Scripts/_Shared/Combat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: caa4d29e142b7744bbe9e57a392c44c8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
28
Assets/02_Scripts/_Shared/Combat/CombatSystem.cs
Normal file
28
Assets/02_Scripts/_Shared/Combat/CombatSystem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class CombatSystem : MonoBehaviour
|
||||
{
|
||||
private PlayerStateMachine _playerStateMachine;
|
||||
private Animator _animator;
|
||||
private float _chargeTimer;
|
||||
|
||||
[SerializeField] private Weapon _currentWeapon; // 현재 장착된 무기
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_playerStateMachine = GetComponent<PlayerStateMachine>();
|
||||
_animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
public void OnAttackInput(InputAction.CallbackContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_playerStateMachine.CurrentState == PlayerState.Charge)
|
||||
_chargeTimer += Time.deltaTime;
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/_Shared/Combat/CombatSystem.cs.meta
Normal file
2
Assets/02_Scripts/_Shared/Combat/CombatSystem.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79c1089a2d7d68f46a2f31d0593a19e0
|
||||
8
Assets/02_Scripts/_Shared/Status.meta
Normal file
8
Assets/02_Scripts/_Shared/Status.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a47b7237c964f64ebde73011ce9d815
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/02_Scripts/_Shared/Status/CharacterIdentity.cs
Normal file
46
Assets/02_Scripts/_Shared/Status/CharacterIdentity.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
|
||||
public enum CharacterType { Playable, NPC, Enemy, None }
|
||||
|
||||
public class CharacterIdentity : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private string _characterCode;
|
||||
public string CharacterCode { get { return _characterCode; } private set { _characterCode = value; } }
|
||||
public bool IsControlling { get; private set; } = false;
|
||||
public bool IsDefaultControl { get; set;}
|
||||
|
||||
public CharacterType GetCharacterType()
|
||||
{
|
||||
string CharacterTypeStr = null;
|
||||
|
||||
if (DataManager.Instance.PlayableCharacterData.TryGetValue(_characterCode, out var c1)) CharacterTypeStr = c1.CharacterType;
|
||||
if (DataManager.Instance.EnemyCharacterData.TryGetValue(_characterCode, out var c2)) CharacterTypeStr = c2.CharacterType;
|
||||
if (DataManager.Instance.NpcCharacterData.TryGetValue(_characterCode, out var c3)) CharacterTypeStr = c3.CharacterType;
|
||||
|
||||
if (CharacterTypeStr == "PLAYABLE")
|
||||
return CharacterType.Playable;
|
||||
|
||||
if (CharacterTypeStr == "ENEMY")
|
||||
return CharacterType.Enemy;
|
||||
|
||||
if (CharacterTypeStr == "NPC")
|
||||
return CharacterType.NPC;
|
||||
|
||||
return CharacterType.None;
|
||||
}
|
||||
|
||||
public void SynchronizeControll()
|
||||
{
|
||||
if (GetCharacterType() != CharacterType.Playable) return;
|
||||
|
||||
// 정렬없이 씬의 모든 PlayerCharacterController 검색
|
||||
PlayerCharacterController[] pccs = Object.FindObjectsByType<PlayerCharacterController>(FindObjectsSortMode.None);
|
||||
|
||||
//모든 컨트롤을 끄고 자기 자신만 킴으로써 IsControlling은 한개체만 true임
|
||||
foreach (PlayerCharacterController pcc in pccs)
|
||||
{
|
||||
pcc.gameObject.GetComponent<CharacterIdentity>().IsControlling = false;
|
||||
}
|
||||
this.IsControlling = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fd13d4fd27d8dc4ebbb2e50c62c4605
|
||||
6
Assets/02_Scripts/_Shared/Status/Health.cs
Normal file
6
Assets/02_Scripts/_Shared/Status/Health.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Health : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
2
Assets/02_Scripts/_Shared/Status/Health.cs.meta
Normal file
2
Assets/02_Scripts/_Shared/Status/Health.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f303ffe19294f641a28378eef3a6cd4
|
||||
8
Assets/02_Scripts/_Shared/Status/Stat.cs
Normal file
8
Assets/02_Scripts/_Shared/Status/Stat.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Stat : MonoBehaviour
|
||||
{
|
||||
public int Lv;
|
||||
public int MaxHp;
|
||||
public int MaxMp;
|
||||
}
|
||||
2
Assets/02_Scripts/_Shared/Status/Stat.cs.meta
Normal file
2
Assets/02_Scripts/_Shared/Status/Stat.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4db0c1abfb006484388f61a5353aca10
|
||||
Reference in New Issue
Block a user