업그레이드 데이터 입력 로직 및 기능 추가
캐릭터 스탯을 PlayerStats 컴포넌트에서 모아서 관리하도록 변경 코드에서도 마찬가지
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user