From 1381c92bbd6374d6f050045f59671d95322a0044 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 19 Mar 2026 02:41:44 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20=EB=B0=B0=EA=B2=BD=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=20=EB=8B=A4=EB=93=AC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Glb/mtl/boat/boat 1.mat | 5 +- .../Glb/mtl/boat/boat 2.mat | 5 +- .../Glb/mtl/boat/boat 4.mat | 7 +- .../Glb/mtl/boat/boat 5.mat | 7 +- .../Glb/mtl/floor.mat | 2 +- .../Scene/[구슬요]미니콘 스테이지 - 바다 위 중정.unity | 4 +- .../Editor/SkyboxTimeControllerEditor.cs | 108 ++++++++++++++++-- .../Background/SkyboxTimeController.cs | 48 ++++++++ 8 files changed, 160 insertions(+), 26 deletions(-) diff --git a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 1.mat b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 1.mat index 076649637..3b3ed21ac 100644 --- a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 1.mat +++ b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 1.mat @@ -26,7 +26,6 @@ Material: m_ModifiedSerializedProperties: 0 m_ValidKeywords: - _NORMALMAP - - _RECEIVE_NILOTOON_CHAR_SHADOW m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 @@ -174,11 +173,11 @@ Material: - _Glossiness: 0 - _GlossyReflections: 0 - _Metallic: 0 - - _NiloToonCharShadowStrength: 1 + - _NiloToonCharShadowStrength: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.005 - _QueueOffset: 0 - - _ReceiveNiloToonCharShadow: 1 + - _ReceiveNiloToonCharShadow: 0 - _ReceiveShadows: 1 - _ScreenSpaceOutlineIntensity: 1 - _ScreenSpaceOutlineWidth: 1 diff --git a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 2.mat b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 2.mat index c2ba61576..b7c206266 100644 --- a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 2.mat +++ b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 2.mat @@ -28,7 +28,6 @@ Material: - _METALLICSPECGLOSSMAP - _NORMALMAP - _PARALLAXMAP - - _RECEIVE_NILOTOON_CHAR_SHADOW m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 @@ -176,11 +175,11 @@ Material: - _Glossiness: 0 - _GlossyReflections: 0 - _Metallic: 0 - - _NiloToonCharShadowStrength: 1 + - _NiloToonCharShadowStrength: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.0353 - _QueueOffset: 0 - - _ReceiveNiloToonCharShadow: 1 + - _ReceiveNiloToonCharShadow: 0 - _ReceiveShadows: 1 - _ScreenSpaceOutlineIntensity: 1 - _ScreenSpaceOutlineWidth: 1 diff --git a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 4.mat b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 4.mat index 9551d8113..012ead0b2 100644 --- a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 4.mat +++ b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 4.mat @@ -24,8 +24,7 @@ Material: m_Shader: {fileID: 4800000, guid: 50e19b7c9fbe3324e978246ad9789e96, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 - m_ValidKeywords: - - _RECEIVE_NILOTOON_CHAR_SHADOW + m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 @@ -173,11 +172,11 @@ Material: - _Glossiness: 0 - _GlossyReflections: 0 - _Metallic: 0.53 - - _NiloToonCharShadowStrength: 1 + - _NiloToonCharShadowStrength: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.005 - _QueueOffset: 0 - - _ReceiveNiloToonCharShadow: 1 + - _ReceiveNiloToonCharShadow: 0 - _ReceiveShadows: 1 - _ScreenSpaceOutlineIntensity: 1 - _ScreenSpaceOutlineWidth: 1 diff --git a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 5.mat b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 5.mat index 715e4a3f3..42a83eabe 100644 --- a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 5.mat +++ b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/boat/boat 5.mat @@ -24,8 +24,7 @@ Material: m_Shader: {fileID: 4800000, guid: 50e19b7c9fbe3324e978246ad9789e96, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 - m_ValidKeywords: - - _RECEIVE_NILOTOON_CHAR_SHADOW + m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 @@ -173,11 +172,11 @@ Material: - _Glossiness: 0 - _GlossyReflections: 0 - _Metallic: 0 - - _NiloToonCharShadowStrength: 1 + - _NiloToonCharShadowStrength: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.005 - _QueueOffset: 0 - - _ReceiveNiloToonCharShadow: 1 + - _ReceiveNiloToonCharShadow: 0 - _ReceiveShadows: 1 - _ScreenSpaceOutlineIntensity: 1 - _ScreenSpaceOutlineWidth: 1 diff --git a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/floor.mat b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/floor.mat index a7241ea5c..69ed25b9b 100644 --- a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/floor.mat +++ b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Glb/mtl/floor.mat @@ -174,7 +174,7 @@ Material: - _Glossiness: 0 - _GlossyReflections: 0 - _Metallic: 0.244 - - _NiloToonCharShadowStrength: 1 + - _NiloToonCharShadowStrength: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.005 - _QueueOffset: 0 diff --git a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Scene/[구슬요]미니콘 스테이지 - 바다 위 중정.unity b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Scene/[구슬요]미니콘 스테이지 - 바다 위 중정.unity index eb252eb25..269ef20c0 100644 --- a/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Scene/[구슬요]미니콘 스테이지 - 바다 위 중정.unity +++ b/Assets/ResourcesData/Background/[구슬요]미니콘 스테이지 - 바다 위 중정/Scene/[구슬요]미니콘 스테이지 - 바다 위 중정.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91acac14ba6f39f713e27a0844e147987da43e54ecf7f74b79c8849e86211ab7 -size 438073 +oid sha256:ced06e5376a98456cae03515a06798743ce1c0500d9dd9ee5aa7fe4d5e1bc5d8 +size 442413 diff --git a/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/SkyboxTimeControllerEditor.cs b/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/SkyboxTimeControllerEditor.cs index b5d139520..ef56bf946 100644 --- a/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/SkyboxTimeControllerEditor.cs +++ b/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/SkyboxTimeControllerEditor.cs @@ -9,6 +9,8 @@ namespace Streamingle.Background.Editor [CustomEditor(typeof(SkyboxTimeController))] public class SkyboxTimeControllerEditor : UnityEditor.Editor { + private const string FoldoutKeyPrefix = "SkyboxTimeController_Foldout_"; + public override VisualElement CreateInspectorGUI() { var root = new VisualElement(); @@ -68,8 +70,11 @@ namespace Streamingle.Background.Editor root.Add(WrapSection(CreateStageFoldout("Stage 2 Settings", "stage2"))); root.Add(WrapSection(CreateStageFoldout("Stage 3 Settings", "stage3"))); + // ── NiloToon Light Override ── + root.Add(WrapSection(CreateNiloToonSection())); + // ── Custom Material Properties ── - var matPropFoldout = CreateFoldout("Custom Material Properties", true); + var matPropFoldout = CreateFoldout("Custom Material Properties", false); matPropFoldout.Add(CreatePropField("materialPropertyOverrides")); root.Add(WrapSection(matPropFoldout)); @@ -85,7 +90,6 @@ namespace Streamingle.Background.Editor return root; } - // section wrapper: 배경 스타일만 담당 private VisualElement WrapSection(VisualElement content) { var section = new VisualElement(); @@ -94,22 +98,103 @@ namespace Streamingle.Background.Editor return section; } - // foldout 생성: 여기에 직접 콘텐츠를 Add private Foldout CreateFoldout(string title, bool defaultOpen) { - var foldout = new Foldout { text = title, value = defaultOpen }; + string key = FoldoutKeyPrefix + title; + bool savedState = SessionState.GetBool(key, defaultOpen); + + var foldout = new Foldout { text = title, value = savedState }; foldout.AddToClassList("section-foldout"); + foldout.RegisterValueChangedCallback(evt => + { + if (evt.target == foldout) + SessionState.SetBool(key, evt.newValue); + }); return foldout; } private Foldout CreateStageFoldout(string title, string propName) { var foldout = CreateFoldout(title, false); - foldout.Add(CreatePropField($"{propName}.lightColor")); - foldout.Add(CreatePropField($"{propName}.lightIntensity")); - foldout.Add(CreatePropField($"{propName}.lightRotation")); - foldout.Add(CreatePropField($"{propName}.skyboxExposure")); - foldout.Add(CreatePropField($"{propName}.skyboxTint")); + + // Directional Light 헤더 + var lightHeader = new Label("Directional Light"); + lightHeader.style.unityFontStyleAndWeight = FontStyle.Bold; + lightHeader.style.marginTop = 4; + foldout.Add(lightHeader); + + foldout.Add(CreatePropField($"{propName}.lightColor", "Light Color")); + foldout.Add(CreatePropField($"{propName}.lightIntensity", "Light Intensity")); + foldout.Add(CreatePropField($"{propName}.lightRotation", "Light Rotation")); + + // Skybox 헤더 + var skyHeader = new Label("Skybox"); + skyHeader.style.unityFontStyleAndWeight = FontStyle.Bold; + skyHeader.style.marginTop = 8; + foldout.Add(skyHeader); + + foldout.Add(CreatePropField($"{propName}.skyboxExposure", "Skybox Exposure")); + foldout.Add(CreatePropField($"{propName}.skyboxTint", "Skybox Tint")); + + return foldout; + } + + private VisualElement CreateNiloToonSection() + { + var foldout = CreateFoldout("NiloToon Light Override", false); + + foldout.Add(CreatePropField("niloToonLightOverrider", "Overrider")); + + // ── Color ── + var colorToggle = CreatePropField("niloToonSeparateColor", "Separate Color"); + foldout.Add(colorToggle); + + var colorContainer = new VisualElement(); + colorContainer.Add(CreatePropField("niloToonColorStage1", "Color Stage 1")); + colorContainer.Add(CreatePropField("niloToonColorStage2", "Color Stage 2")); + colorContainer.Add(CreatePropField("niloToonColorStage3", "Color Stage 3")); + foldout.Add(colorContainer); + + // ── Intensity ── + var intensityToggle = CreatePropField("niloToonSeparateIntensity", "Separate Intensity"); + foldout.Add(intensityToggle); + + var intensityContainer = new VisualElement(); + intensityContainer.Add(CreatePropField("niloToonIntensityStage1", "Intensity Stage 1")); + intensityContainer.Add(CreatePropField("niloToonIntensityStage2", "Intensity Stage 2")); + intensityContainer.Add(CreatePropField("niloToonIntensityStage3", "Intensity Stage 3")); + foldout.Add(intensityContainer); + + // Visibility: separate 꺼져 있으면 숨김 + void UpdateColorVisibility() + { + var prop = serializedObject.FindProperty("niloToonSeparateColor"); + colorContainer.style.display = prop.boolValue ? DisplayStyle.Flex : DisplayStyle.None; + } + + void UpdateIntensityVisibility() + { + var prop = serializedObject.FindProperty("niloToonSeparateIntensity"); + intensityContainer.style.display = prop.boolValue ? DisplayStyle.Flex : DisplayStyle.None; + } + + colorToggle.RegisterValueChangeCallback(_ => UpdateColorVisibility()); + intensityToggle.RegisterValueChangeCallback(_ => UpdateIntensityVisibility()); + + // 초기 visibility + foldout.schedule.Execute(() => + { + UpdateColorVisibility(); + UpdateIntensityVisibility(); + }); + + // info label + var info = new Label("Off일 때 디렉셔널 라이트 값을 그대로 사용합니다."); + info.style.color = new Color(0.5f, 0.5f, 0.5f); + info.style.fontSize = 10; + info.style.marginTop = 4; + foldout.Add(info); + return foldout; } @@ -118,6 +203,11 @@ namespace Streamingle.Background.Editor return new PropertyField(serializedObject.FindProperty(path)); } + private PropertyField CreatePropField(string path, string label) + { + return new PropertyField(serializedObject.FindProperty(path), label); + } + private Button CreateQuickButton(string label, float value, Slider slider, SkyboxTimeController controller) { var btn = new Button(() => diff --git a/Assets/Scripts/Streamingle/StreamingleControl/Background/SkyboxTimeController.cs b/Assets/Scripts/Streamingle/StreamingleControl/Background/SkyboxTimeController.cs index dec96fcfa..d022f3ee7 100644 --- a/Assets/Scripts/Streamingle/StreamingleControl/Background/SkyboxTimeController.cs +++ b/Assets/Scripts/Streamingle/StreamingleControl/Background/SkyboxTimeController.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using NiloToon.NiloToonURP; using UnityEngine; namespace Streamingle.Background @@ -65,6 +66,22 @@ namespace Streamingle.Background [Tooltip("머티리얼의 임의 프로퍼티를 3단계로 보간 제어")] public List materialPropertyOverrides = new List(); + // ───────────────────────── NiloToon Light Override ───────────────────────── + [Tooltip("NiloToon 캐릭터 메인 라이트 오버라이더 (디렉셔널 라이트와 동기화)")] + public NiloToonCharacterMainLightOverrider niloToonLightOverrider; + + [Tooltip("NiloToon 라이트 컬러를 별도로 지정할지 여부 (false면 디렉셔널 라이트와 동일)")] + public bool niloToonSeparateColor = false; + public Color niloToonColorStage1 = Color.white; + public Color niloToonColorStage2 = Color.white; + public Color niloToonColorStage3 = Color.white; + + [Tooltip("NiloToon 라이트 Intensity를 별도로 지정할지 여부 (false면 디렉셔널 라이트와 동일)")] + public bool niloToonSeparateIntensity = false; + public float niloToonIntensityStage1 = 1f; + public float niloToonIntensityStage2 = 1f; + public float niloToonIntensityStage3 = 1f; + // ───────────────────────── Ambient ───────────────────────── [Tooltip("Ambient 컬러도 함께 보간")] public bool controlAmbient = true; @@ -172,6 +189,37 @@ namespace Streamingle.Background directionalLight.transform.rotation = Quaternion.Euler(current.lightRotation); } + // ── NiloToon Light Override ── + if (niloToonLightOverrider != null) + { + // Direction: 디렉셔널 라이트와 동일한 rotation 적용 + niloToonLightOverrider.transform.rotation = Quaternion.Euler(current.lightRotation); + + // Color + if (niloToonSeparateColor) + { + niloToonLightOverrider.color = t < 0.5f + ? Color.Lerp(niloToonColorStage1, niloToonColorStage2, t * 2f) + : Color.Lerp(niloToonColorStage2, niloToonColorStage3, (t - 0.5f) * 2f); + } + else + { + niloToonLightOverrider.color = current.lightColor; + } + + // Intensity + if (niloToonSeparateIntensity) + { + niloToonLightOverrider.intensity = t < 0.5f + ? Mathf.Lerp(niloToonIntensityStage1, niloToonIntensityStage2, t * 2f) + : Mathf.Lerp(niloToonIntensityStage2, niloToonIntensityStage3, (t - 0.5f) * 2f); + } + else + { + niloToonLightOverrider.intensity = current.lightIntensity; + } + } + // ── Ambient ── if (controlAmbient) {