Merge branch 'wl/gameplay/WL-816w-island-fixes'
This commit is contained in:
commit
bd862b70d7
|
|
@ -50,6 +50,10 @@ MonoBehaviour:
|
||||||
gateFlowEnabled: 1
|
gateFlowEnabled: 1
|
||||||
hideFarms: 1
|
hideFarms: 1
|
||||||
farmReHideDelaySeconds: 3
|
farmReHideDelaySeconds: 3
|
||||||
|
showFarmSoil: 1
|
||||||
|
hideIslandFences: 1
|
||||||
|
islandFenceNamePrefixes:
|
||||||
|
- Fence
|
||||||
matchNewTileMaterials: 1
|
matchNewTileMaterials: 1
|
||||||
dungeonUnlockPrefsKey: WL_Island_DungeonsUnlocked
|
dungeonUnlockPrefsKey: WL_Island_DungeonsUnlocked
|
||||||
dungeonUnlockPrices: 0a0000001e0000003c00000064000000
|
dungeonUnlockPrices: 0a0000001e0000003c00000064000000
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ using UnityEngine.SceneManagement;
|
||||||
using FIFarm = CryingSnow.FarmingIsland.Farm;
|
using FIFarm = CryingSnow.FarmingIsland.Farm;
|
||||||
using FIIsland = CryingSnow.FarmingIsland.Island;
|
using FIIsland = CryingSnow.FarmingIsland.Island;
|
||||||
using FIIslandManager = CryingSnow.FarmingIsland.IslandManager;
|
using FIIslandManager = CryingSnow.FarmingIsland.IslandManager;
|
||||||
|
using FISoil = CryingSnow.FarmingIsland.Soil;
|
||||||
using FIPurchaser = CryingSnow.FarmingIsland.Purchaser;
|
using FIPurchaser = CryingSnow.FarmingIsland.Purchaser;
|
||||||
using FIPurchaserData = CryingSnow.FarmingIsland.PurchaserData;
|
using FIPurchaserData = CryingSnow.FarmingIsland.PurchaserData;
|
||||||
|
|
||||||
|
|
@ -88,6 +89,8 @@ namespace WL.Island
|
||||||
Vector3 farmCenter;
|
Vector3 farmCenter;
|
||||||
bool haveFarm = HideFarms(cfg, scene, out farmCenter);
|
bool haveFarm = HideFarms(cfg, scene, out farmCenter);
|
||||||
|
|
||||||
|
HideIslandFences(cfg, scene, null);
|
||||||
|
|
||||||
HookIslandActivation(cfg, scene);
|
HookIslandActivation(cfg, scene);
|
||||||
|
|
||||||
s_farmCenter = farmCenter;
|
s_farmCenter = farmCenter;
|
||||||
|
|
@ -278,6 +281,8 @@ namespace WL.Island
|
||||||
if (!zoneSet) { zone = rends[r].bounds; zoneSet = true; } // WL-816u — 구역 전체
|
if (!zoneSet) { zone = rends[r].bounds; zoneSet = true; } // WL-816u — 구역 전체
|
||||||
else zone.Encapsulate(rends[r].bounds);
|
else zone.Encapsulate(rends[r].bounds);
|
||||||
}
|
}
|
||||||
|
// 🔴 WL-816w ③ — 흙칸(Soil)은 남긴다(밭 자리가 흙으로 보이게). 콜라이더는 아래에서 끈다.
|
||||||
|
if (IsSoilRenderer(cfg, rends[r])) { SoilRenderersKept++; continue; }
|
||||||
rends[r].enabled = false; s_hiddenRends.Add(rends[r]); RenderersHidden++;
|
rends[r].enabled = false; s_hiddenRends.Add(rends[r]); RenderersHidden++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -312,6 +317,60 @@ namespace WL.Island
|
||||||
public static Bounds ZoneBounds;
|
public static Bounds ZoneBounds;
|
||||||
public static bool ZoneBoundsValid;
|
public static bool ZoneBoundsValid;
|
||||||
|
|
||||||
|
/// <summary>WL-816w 진단 — 남겨 둔 흙칸 렌더러 수 · 끈 울타리 렌더러 수.</summary>
|
||||||
|
public static int SoilRenderersKept, FenceRenderersHidden;
|
||||||
|
|
||||||
|
/// <summary>WL-816w ③ — 이 렌더러가 흙칸(FI `Soil`)의 것인가(자기 자신 또는 부모).</summary>
|
||||||
|
static bool IsSoilRenderer(WLIslandSettings cfg, Renderer r)
|
||||||
|
{
|
||||||
|
if (cfg.showFarmSoil == 0 || r == null) return false;
|
||||||
|
return r.GetComponentInParent<FISoil>(true) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 🔴 WL-816w ② — FI 섬 타일의 장식 **울타리**를 화면에서 없앤다(렌더러만 · 원본 0줄).
|
||||||
|
/// 실측(816w): `IslandManager/Island (0)/Fence01`·`(1)`·`(2)` 3개가 밭 옆 (6·8·10, 0, 4) 에 서 있고
|
||||||
|
/// **Farm 자식이 아니라 섬 타일 자식**이라 816g 의 밭 숨김이 훑지 못했다.
|
||||||
|
/// `isl` 이 null 이면 씬 전체, 아니면 그 섬만 훑는다(확장으로 새로 열린 타일).
|
||||||
|
/// </summary>
|
||||||
|
static void HideIslandFences(WLIslandSettings cfg, Scene scene, FIIsland isl)
|
||||||
|
{
|
||||||
|
if (cfg == null || cfg.hideIslandFences == 0) return;
|
||||||
|
var pre = cfg.islandFenceNamePrefixes;
|
||||||
|
if (pre == null || pre.Length == 0) return;
|
||||||
|
|
||||||
|
if (isl != null) { HideFencesUnder(pre, isl.transform); return; }
|
||||||
|
|
||||||
|
var islands = Object.FindObjectsByType<FIIsland>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||||
|
for (int i = 0; i < islands.Length; i++)
|
||||||
|
{
|
||||||
|
if (islands[i] == null) continue;
|
||||||
|
if (scene.IsValid() && islands[i].gameObject.scene != scene) continue;
|
||||||
|
HideFencesUnder(pre, islands[i].transform);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HideFencesUnder(string[] pre, Transform root)
|
||||||
|
{
|
||||||
|
for (int c = 0; c < root.childCount; c++)
|
||||||
|
{
|
||||||
|
var ch = root.GetChild(c);
|
||||||
|
bool hit = false;
|
||||||
|
for (int p = 0; p < pre.Length; p++)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(pre[p])) continue;
|
||||||
|
if (ch.name.StartsWith(pre[p], System.StringComparison.OrdinalIgnoreCase)) { hit = true; break; }
|
||||||
|
}
|
||||||
|
if (!hit) continue;
|
||||||
|
var rends = ch.GetComponentsInChildren<Renderer>(true);
|
||||||
|
for (int r = 0; r < rends.Length; r++)
|
||||||
|
{
|
||||||
|
if (rends[r] == null || !rends[r].enabled) continue;
|
||||||
|
rends[r].enabled = false; s_hiddenRends.Add(rends[r]); FenceRenderersHidden++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>섬이 나중에 열리면 ① 그 섬의 밭을 다시 숨기고 ② 타일 재질을 기존 타일과 맞춘다(§1).</summary>
|
/// <summary>섬이 나중에 열리면 ① 그 섬의 밭을 다시 숨기고 ② 타일 재질을 기존 타일과 맞춘다(§1).</summary>
|
||||||
static void HookIslandActivation(WLIslandSettings cfg, Scene scene)
|
static void HookIslandActivation(WLIslandSettings cfg, Scene scene)
|
||||||
{
|
{
|
||||||
|
|
@ -347,6 +406,8 @@ namespace WL.Island
|
||||||
|
|
||||||
MatchTileMaterials(cfg, isl);
|
MatchTileMaterials(cfg, isl);
|
||||||
|
|
||||||
|
HideIslandFences(cfg, isl.gameObject.scene, isl); // WL-816w ② — 새로 열린 타일의 울타리도
|
||||||
|
|
||||||
if (cfg.hideFarms == 0) yield break;
|
if (cfg.hideFarms == 0) yield break;
|
||||||
var farms = isl.GetComponentsInChildren<FIFarm>(true);
|
var farms = isl.GetComponentsInChildren<FIFarm>(true);
|
||||||
for (int i = 0; i < farms.Length; i++)
|
for (int i = 0; i < farms.Length; i++)
|
||||||
|
|
@ -354,7 +415,11 @@ namespace WL.Island
|
||||||
if (farms[i] == null) continue;
|
if (farms[i] == null) continue;
|
||||||
var rends = farms[i].GetComponentsInChildren<Renderer>(true);
|
var rends = farms[i].GetComponentsInChildren<Renderer>(true);
|
||||||
for (int r = 0; r < rends.Length; r++)
|
for (int r = 0; r < rends.Length; r++)
|
||||||
if (rends[r] != null && rends[r].enabled) { rends[r].enabled = false; s_hiddenRends.Add(rends[r]); RenderersHidden++; }
|
{
|
||||||
|
if (rends[r] == null || !rends[r].enabled) continue;
|
||||||
|
if (IsSoilRenderer(cfg, rends[r])) { SoilRenderersKept++; continue; } // WL-816w ③
|
||||||
|
rends[r].enabled = false; s_hiddenRends.Add(rends[r]); RenderersHidden++;
|
||||||
|
}
|
||||||
var cols = farms[i].GetComponentsInChildren<Collider>(true);
|
var cols = farms[i].GetComponentsInChildren<Collider>(true);
|
||||||
for (int c = 0; c < cols.Length; c++)
|
for (int c = 0; c < cols.Length; c++)
|
||||||
if (cols[c] != null && cols[c].enabled) { cols[c].enabled = false; s_hiddenCols.Add(cols[c]); }
|
if (cols[c] != null && cols[c].enabled) { cols[c].enabled = false; s_hiddenCols.Add(cols[c]); }
|
||||||
|
|
|
||||||
|
|
@ -224,6 +224,19 @@ namespace WL.Island
|
||||||
"(확장 연출 1초 + 흙칸 연출 + 룩 재적용 1.4초가 끝날 시간).")]
|
"(확장 연출 1초 + 흙칸 연출 + 룩 재적용 1.4초가 끝날 시간).")]
|
||||||
public float farmReHideDelaySeconds = 3.0f;
|
public float farmReHideDelaySeconds = 3.0f;
|
||||||
|
|
||||||
|
[Tooltip("🔴 WL-816w ③ — 1 이면 밭을 숨길 때 **흙칸(Soil) 렌더러는 남긴다** = 밭 자리가 " +
|
||||||
|
"초록 풀밭이 아니라 **흙**으로 보인다(PD 지시). 콜라이더는 그대로 꺼지므로 " +
|
||||||
|
"농사·상호작용은 계속 비활성이다. 0 = 816g 동작(흙칸까지 통째로 숨김).")]
|
||||||
|
public int showFarmSoil = 1;
|
||||||
|
|
||||||
|
[Tooltip("🔴 WL-816w ② — 1 이면 FI 섬 타일의 장식 **울타리**(Island/Fence*) 렌더러를 끈다. " +
|
||||||
|
"인게임이 아닌 섬에 말뚝 울타리가 서 있는 것을 PD 가 지적했다. " +
|
||||||
|
"밭(Farm) 자식이 아니라 **섬 타일 자식**이라 816g 밭 숨김이 훑지 못했다(실측).")]
|
||||||
|
public int hideIslandFences = 1;
|
||||||
|
|
||||||
|
[Tooltip("울타리로 판정할 오브젝트 이름 접두어(대소문자 무시).")]
|
||||||
|
public string[] islandFenceNamePrefixes = new[] { "Fence" };
|
||||||
|
|
||||||
[Tooltip("🔴 §1 — 1 이면 **새로 열린 타일**의 머티리얼 배열을 이미 열려 있는 타일과 **같게** 만든다. " +
|
[Tooltip("🔴 §1 — 1 이면 **새로 열린 타일**의 머티리얼 배열을 이미 열려 있는 타일과 **같게** 만든다. " +
|
||||||
"실측: 바닥 색 자체는 이미 같지만(main b1e58d795), 새 타일만 외곽선 패스(WL/HullOutline)를 " +
|
"실측: 바닥 색 자체는 이미 같지만(main b1e58d795), 새 타일만 외곽선 패스(WL/HullOutline)를 " +
|
||||||
"못 받아 경계에서 테두리 유무가 갈린다. 새 머티리얼을 만들지 않고 기존 배열을 물려준다.")]
|
"못 받아 경계에서 테두리 유무가 갈린다. 새 머티리얼을 만들지 않고 기존 배열을 물려준다.")]
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ MonoBehaviour:
|
||||||
soilTint: {r: 0.84, g: 0.86, b: 0.9, a: 1}
|
soilTint: {r: 0.84, g: 0.86, b: 0.9, a: 1}
|
||||||
soilCheckerContrast: 0.6
|
soilCheckerContrast: 0.6
|
||||||
soilTargetEnabled: 1
|
soilTargetEnabled: 1
|
||||||
soilTargetColor: {r: 0.3049, g: 0.4033, b: 0.2961, a: 1}
|
soilTargetColor: {r: 0.591, g: 0.65, b: 0.541, a: 1}
|
||||||
ambientSky: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
ambientSky: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||||
ambientEquator: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
ambientEquator: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||||
ambientGround: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
ambientGround: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue