diff --git a/Assets/WL/Island/WLIslandTileFenceStrip.cs b/Assets/WL/Island/WLIslandTileFenceStrip.cs index 3a0cf95ff..3fd449069 100644 --- a/Assets/WL/Island/WLIslandTileFenceStrip.cs +++ b/Assets/WL/Island/WLIslandTileFenceStrip.cs @@ -14,19 +14,21 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using FIIsland = CryingSnow.FarmingIsland.Island; +using FIIslandManager = CryingSnow.FarmingIsland.IslandManager; namespace WL.Island { public static class WLIslandTileFenceStrip { static readonly Dictionary s_cache = new Dictionary(); - public static int TilesStripped, TrianglesRemoved, Unreadable; + public static int TilesStripped, TrianglesRemoved, Unreadable, SourceReplaced; public static string LastLog = ""; /// 섬 씬의 타일(FI Island)마다 메시를 검사해 난간 삼각형이 있으면 잘라낸 복제본으로 바꾼다(멱등). public static void Apply(WLIslandSettings cfg, Scene scene) { if (cfg == null || cfg.stripBakedFences == 0) return; + ReplaceSourceList(cfg, scene); var isls = Object.FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None); int changed = 0; for (int i = 0; i < isls.Length; i++) @@ -49,6 +51,34 @@ namespace WL.Island } } + /// + /// 2026-09-15 Lead 실측 — 원본 `Island.ConfigureIsland` 가 확장·재구성 때마다 `IslandManager.islandMeshes[i]`(원본 메시)를 + /// 타일에 **다시 물려** 잘라낸 복제본이 원본으로 되돌아간다(화면의 타일 메시명이 `04`·`07` 등 원본 그대로였다). + /// 그래서 원천인 그 목록의 항목 자체를 잘라낸 복제본으로 바꿔 둔다(리플렉션 · 원본 0줄) — 이후 어떤 시점에 물려도 난간 없음. + /// + static void ReplaceSourceList(WLIslandSettings cfg, Scene scene) + { + var mgrs = Object.FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None); + if (mgrs == null || mgrs.Length == 0) return; + var field = typeof(FIIslandManager).GetField("islandMeshes", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public); + if (field == null) return; + for (int k = 0; k < mgrs.Length; k++) + { + var mgr = mgrs[k]; + if (mgr == null || (scene.IsValid() && mgr.gameObject.scene != scene)) continue; + var list = field.GetValue(mgr) as List; + if (list == null) continue; + for (int i = 0; i < list.Count; i++) + { + var src = list[i]; + if (src == null || src.name.EndsWith("_nofence")) continue; + Mesh dst; + if (!s_cache.TryGetValue(src, out dst)) { dst = Strip(src, cfg.fenceStripMinY); s_cache[src] = dst; } + if (dst != null && dst != src) { list[i] = dst; SourceReplaced++; } + } + } + } + static Mesh Strip(Mesh src, float minY) { // 🔴 Read/Write 가 꺼진 메시는 접근 자체가 Unity 에러 로그(→ 게임 팝업)를 낸다 — 예외가 아니라 로그라 try/catch 로 못 막는다. diff --git a/Assets/WL/Island/WLIslandTileFenceStrip.cs.meta b/Assets/WL/Island/WLIslandTileFenceStrip.cs.meta new file mode 100644 index 000000000..5bb2a3f64 --- /dev/null +++ b/Assets/WL/Island/WLIslandTileFenceStrip.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 46247c798030a9746bf06e12f9b45a4f \ No newline at end of file diff --git a/Assets/WL/Look/Farm/WLSoftDirt.cs.meta b/Assets/WL/Look/Farm/WLSoftDirt.cs.meta new file mode 100644 index 000000000..fd423ce3c --- /dev/null +++ b/Assets/WL/Look/Farm/WLSoftDirt.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 870b83e7cd0b2b144abba6944bc2ea9a \ No newline at end of file