From b427225a53a5027b3df3c0dc8b2d76e22fa11a59 Mon Sep 17 00:00:00 2001 From: yousan Date: Wed, 5 Feb 2025 17:31:17 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20Default=E3=81=AEshader=E3=82=92MToon?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 設定からモデルロード時にshaderをlilToonに変更可能 --- .../Scripts/Common/ApplicationSettingData.cs | 5 +++++ .../Scripts/Utility/LoadCharacterModel.cs | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Assets/uDesktopMascot/Scripts/Common/ApplicationSettingData.cs b/Assets/uDesktopMascot/Scripts/Common/ApplicationSettingData.cs index dd961f97..42553358 100644 --- a/Assets/uDesktopMascot/Scripts/Common/ApplicationSettingData.cs +++ b/Assets/uDesktopMascot/Scripts/Common/ApplicationSettingData.cs @@ -112,6 +112,11 @@ public float RotationZ if (_rotationZ < 0) _rotationZ += 360.0f; } } + + /// + /// キャラクターのShaderにLilToonを使用するかどうか + /// + public bool UseLilToon { get; set; } = false; } /// diff --git a/Assets/uDesktopMascot/Scripts/Utility/LoadCharacterModel.cs b/Assets/uDesktopMascot/Scripts/Utility/LoadCharacterModel.cs index 69413825..2bdec5cb 100644 --- a/Assets/uDesktopMascot/Scripts/Utility/LoadCharacterModel.cs +++ b/Assets/uDesktopMascot/Scripts/Utility/LoadCharacterModel.cs @@ -76,14 +76,17 @@ public static async UniTask LoadModel(CancellationToken cancellation } } - // シェーダーをlilToonに置き換える - bool shaderReplaceSuccess = ReplaceShadersWithLilToon(model); - - if (!shaderReplaceSuccess) + if (characterSettings.UseLilToon) { - Log.Warning("シェーダーの置き換えに失敗したため、デフォルトのシェーダーを使用します。"); - } + // シェーダーをlilToonに置き換える + bool shaderReplaceSuccess = ReplaceShadersWithLilToon(model); + if (!shaderReplaceSuccess) + { + Log.Warning("シェーダーの置き換えに失敗したため、デフォルトのシェーダーを使用します。"); + } + } + return model; } From 76062049ff2fe3abe609bf6ff6893d48a4341510 Mon Sep 17 00:00:00 2001 From: yousan Date: Wed, 5 Feb 2025 18:49:19 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E3=82=A2=E3=83=97=E3=83=AA=E7=B5=82?= =?UTF-8?q?=E4=BA=86=E6=99=82=E3=81=AB=E3=82=A2=E3=83=97=E3=83=AA=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=83=87=E3=83=BC=E3=82=BF=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/uDesktopMascot/Scripts/Manager/SystemManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/uDesktopMascot/Scripts/Manager/SystemManager.cs b/Assets/uDesktopMascot/Scripts/Manager/SystemManager.cs index ab026a5b..d2e95d5e 100644 --- a/Assets/uDesktopMascot/Scripts/Manager/SystemManager.cs +++ b/Assets/uDesktopMascot/Scripts/Manager/SystemManager.cs @@ -240,6 +240,7 @@ public void DisposeWebServer() /// private void OnDestroy() { + ApplicationSettings.Instance.SaveSettings(); _cancellationTokenSource?.Cancel(); _cancellationTokenSource?.Dispose(); _webServiceHost?.Dispose();