액션 및 인터랙션 시 장비를 착용할 수 있도록 함. 코드 개선 추가

This commit is contained in:
2026-01-28 16:08:12 +09:00
parent 42f5462b54
commit 2539b0f4ba
22 changed files with 323 additions and 206 deletions

View File

@@ -22,9 +22,10 @@ namespace Northbound
public string interactionAnimationTrigger = "Mining"; // 플레이어 애니메이션 트리거
[Header("Equipment")]
public InteractionEquipmentData equipmentData = new InteractionEquipmentData
public EquipmentData equipmentData = new EquipmentData
{
socketName = "RightHand",
equipmentPrefab = null, // Inspector에서 곡괭이 프리팹 할당
attachOnStart = true,
detachOnEnd = true
};
@@ -46,7 +47,7 @@ namespace Northbound
{
if (IsServer)
{
_currentResources.Value = 0;
_currentResources.Value = maxResources;
_lastRechargeTime = Time.time;
}
}
@@ -63,10 +64,10 @@ namespace Northbound
{
int rechargeAmountToAdd = Mathf.Min(rechargeAmount, maxResources - _currentResources.Value);
_currentResources.Value += rechargeAmountToAdd;
// Debug.Log($"{resourceName} {rechargeAmountToAdd} 충전됨. 현재: {_currentResources.Value}/{maxResources}");
}
_lastRechargeTime = Time.time;
}
}
@@ -82,7 +83,7 @@ namespace Northbound
return false;
// 플레이어 인벤토리 확인
if (NetworkManager.Singleton != null &&
if (NetworkManager.Singleton != null &&
NetworkManager.Singleton.ConnectedClients.TryGetValue(playerId, out var client))
{
if (client.PlayerObject != null)
@@ -128,7 +129,7 @@ namespace Northbound
// 플레이어가 받을 수 있는 최대량 계산
int playerAvailableSpace = playerInventory.GetAvailableSpace();
// 자원 노드가 줄 수 있는 양과 플레이어가 받을 수 있는 양 중 작은 값 선택
int gatheredAmount = Mathf.Min(
resourcesPerGathering,
@@ -168,7 +169,7 @@ namespace Northbound
{
if (_currentResources.Value <= 0)
return "자원 충전 중...";
return $"[E] {resourceName} 채집 ({_currentResources.Value}/{maxResources})";
}
@@ -177,7 +178,7 @@ namespace Northbound
return interactionAnimationTrigger;
}
public InteractionEquipmentData GetEquipmentData()
public EquipmentData GetEquipmentData()
{
return equipmentData;
}