업그레이드 데이터 입력 로직 및 기능 추가

캐릭터 스탯을 PlayerStats 컴포넌트에서 모아서 관리하도록 변경
코드에서도 마찬가지
This commit is contained in:
2026-02-23 00:21:44 +09:00
parent b34254137f
commit cc475bce3e
54 changed files with 1402 additions and 98 deletions

View File

@@ -8,11 +8,11 @@ namespace Northbound
/// </summary>
public class PlayerVisionProvider : NetworkBehaviour, IVisionProvider
{
[Header("Vision Settings")]
public float visionRange = 10f;
private PlayerStats _playerStats;
public override void OnNetworkSpawn()
{
_playerStats = GetComponent<PlayerStats>();
if (IsServer)
{
FogOfWarSystem.Instance?.RegisterVisionProvider(this);
@@ -28,14 +28,14 @@ namespace Northbound
}
public ulong GetOwnerId() => OwnerClientId;
public float GetVisionRange() => visionRange;
public float GetVisionRange() => _playerStats?.GetSight() ?? 10f;
public Transform GetTransform() => transform;
public bool IsActive() => IsSpawned;
private void OnDrawGizmosSelected()
{
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(transform.position, visionRange);
Gizmos.DrawWireSphere(transform.position, GetVisionRange());
}
}
}
}