From 3a2b5c70541384bafed211a5f1bfe75524968a8d Mon Sep 17 00:00:00 2001 From: dal4segno Date: Sun, 1 Feb 2026 01:52:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=90=EB=94=94=ED=84=B0=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=A0=84=EC=9E=A5=EC=9D=98=20=EC=95=88=EA=B0=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=EC=9D=84=20=EB=81=8C=20=EC=88=98=20=EC=9E=88=EB=8A=94?= =?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/FogOfWarRenderer.cs | 19 +++++++++++++++++++ Assets/Scripts/FogOfWarSystem.cs | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/Assets/Scripts/FogOfWarRenderer.cs b/Assets/Scripts/FogOfWarRenderer.cs index 56a9002..d4d3ee3 100644 --- a/Assets/Scripts/FogOfWarRenderer.cs +++ b/Assets/Scripts/FogOfWarRenderer.cs @@ -89,6 +89,13 @@ namespace Northbound Debug.LogWarning("[FogOfWar] Fog Material이 설정되지 않았습니다!"); } +#if UNITY_EDITOR + if (fogSystem.disableInEditor) + { + _meshRenderer.enabled = false; + } +#endif + // 렌더링 레이어 설정 gameObject.layer = LayerMask.NameToLayer("UI"); // 또는 별도 레이어 생성 @@ -123,6 +130,18 @@ namespace Northbound var fogSystem = FogOfWarSystem.Instance; if (fogSystem == null) return; +#if UNITY_EDITOR + if (fogSystem.disableInEditor) + { + if (_meshRenderer != null) + _meshRenderer.enabled = false; + return; + } +#endif + + if (_meshRenderer != null) + _meshRenderer.enabled = true; + var fogData = fogSystem.GetPlayerFogData(_localClientId); for (int y = 0; y < fogSystem.gridHeight; y++) diff --git a/Assets/Scripts/FogOfWarSystem.cs b/Assets/Scripts/FogOfWarSystem.cs index a49f540..e99db4d 100644 --- a/Assets/Scripts/FogOfWarSystem.cs +++ b/Assets/Scripts/FogOfWarSystem.cs @@ -217,6 +217,10 @@ namespace Northbound [Tooltip("Minimum obstacle height to block vision")] public float minBlockingHeight = 2.0f; + [Header("Editor Settings")] + [Tooltip("Disable fog of war in Unity Editor for easier development")] + public bool disableInEditor = true; + // 서버: 각 플레이어별 가시성 맵 private Dictionary _serverFogData = new Dictionary(); @@ -462,6 +466,11 @@ namespace Northbound /// public FogOfWarState GetVisibilityState(ulong clientId, Vector3 worldPosition) { +#if UNITY_EDITOR + if (disableInEditor) + return FogOfWarState.Visible; +#endif + FogOfWarData fogData = GetPlayerFogData(clientId); if (fogData == null) return FogOfWarState.Unexplored;