From 0b26a937da997f872ae695a12858f026619de535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Mon, 31 Oct 2022 02:10:36 +0800 Subject: [PATCH 1/4] change glasses shader #1 --- Assets/Scripts/UmaViewerBuilder.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index 67c8cf7..08ee361 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -33,6 +33,7 @@ public class UmaViewerBuilder : MonoBehaviour public Shader eyeShader; public Shader cheekShader; public Shader eyebrowShader; + public Shader alphaShader; public List CurrentAudioSources = new List(); public List CurrentLyrics = new List(); @@ -618,6 +619,7 @@ public class UmaViewerBuilder : MonoBehaviour eyeShader = (Shader)bundle.LoadAsset("assets/_gallop/resources/shader/3d/character/charactertooneyet.shader"); cheekShader = (Shader)bundle.LoadAsset("assets/_gallop/resources/shader/3d/character/charactermultiplycheek.shader"); eyebrowShader = (Shader)bundle.LoadAsset("assets/_gallop/resources/shader/3d/character/charactertoonmayu.shader"); + alphaShader = (Shader)bundle.LoadAsset("assets/_gallop/resources/shader/3d/character/characteralphanolinetoonhairtser.shader"); Main.ShadersLoaded = true; } } @@ -830,6 +832,10 @@ public class UmaViewerBuilder : MonoBehaviour } else { + if (r.name.Contains("Hair") && r.name.Contains("Alpha")) + { + m.shader = alphaShader; + } switch (m.shader.name) { case "Gallop/3D/Chara/MultiplyCheek": From 7b2cad4bc918d3635b83861e135407da9ab1af50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Mon, 31 Oct 2022 02:16:46 +0800 Subject: [PATCH 2/4] fix glasses issue --- Assets/Scripts/UmaViewerBuilder.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index 08ee361..7fa39c2 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -832,6 +832,7 @@ public class UmaViewerBuilder : MonoBehaviour } else { + //Glasses's shader need to change manually. if (r.name.Contains("Hair") && r.name.Contains("Alpha")) { m.shader = alphaShader; From 6d980eda0ca53e64ab04268449d34ce03557a77b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Mon, 31 Oct 2022 03:14:34 +0800 Subject: [PATCH 3/4] bug fix --- Assets/Scripts/UmaContainer.cs | 4 ---- Assets/Scripts/UmaViewerBuilder.cs | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Assets/Scripts/UmaContainer.cs b/Assets/Scripts/UmaContainer.cs index ec2f5cc..542f301 100644 --- a/Assets/Scripts/UmaContainer.cs +++ b/Assets/Scripts/UmaContainer.cs @@ -50,10 +50,6 @@ public class UmaContainer : MonoBehaviour public void OnDestroy() { - if (FaceDrivenKeyTargets != null) - { - UmaViewerUI.Instance.LoadFacialPanels(null); - } if (TryGetComponent(out PuppetMaster t)) { Destroy(this); diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index 7fa39c2..f881777 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -1017,6 +1017,7 @@ public class UmaViewerBuilder : MonoBehaviour { if (CurrentUMAContainer != null) { + UmaViewerUI.Instance.LoadFacialPanels(null); Destroy(CurrentUMAContainer.gameObject); } } From 910e020e0875644b97dd605d25f6388aa970f96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Mon, 31 Oct 2022 03:52:07 +0800 Subject: [PATCH 4/4] bug fix --- Assets/Scripts/UmaViewerBuilder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index f881777..a69febb 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -966,6 +966,7 @@ public class UmaViewerBuilder : MonoBehaviour public void UnloadAllBundle(bool unloadAllObjects = false) { + foreach (var bundle in Main.LoadedBundles) { bundle.Value.Unload(unloadAllObjects); @@ -1017,6 +1018,7 @@ public class UmaViewerBuilder : MonoBehaviour { if (CurrentUMAContainer != null) { + //It seems that OnDestroy will executed after new model loaded, which cause new FacialPanels empty... UmaViewerUI.Instance.LoadFacialPanels(null); Destroy(CurrentUMAContainer.gameObject); }