Mineable 블록에 대해 전장의 안개 추가

그림자 안나오는 문제도 해결
This commit is contained in:
2026-01-17 20:14:12 +09:00
parent 443942f6ca
commit 8369e4d42f
47 changed files with 1991 additions and 2730 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
using Unity.Netcode;
public class FogOfWarManager : MonoBehaviour
{
public static FogOfWarManager Instance;
[Header("Settings")]
public RenderTexture fogMaskTexture; // 쉐이더에 전달될 텍스처
public Material fogMaterial; // 검은 안개 머티리얼
public float revealRadius = 5f; // 밝혀지는 반경
void Awake() => Instance = this;
void Update()
{
// 멀티플레이어이므로 로컬 플레이어(IsOwner)의 위치만 마스크에 그립니다.
if (NetworkManager.Singleton.LocalClient != null)
{
var localPlayer = NetworkManager.Singleton.LocalClient.PlayerObject;
if (localPlayer != null)
{
UpdateFogMask(localPlayer.transform.position);
}
}
}
private void UpdateFogMask(Vector3 playerPos)
{
// 플레이어의 월드 좌표를 텍스처 좌표로 변환하여
// 해당 지점의 알파값을 0(투명)으로 깎아내는 로직 (Compute Shader나 GPU 가속 권장)
}
}