Skip to content

Commit

Permalink
Merge pull request #131 from MidraLab/fix/load_model_default_shader
Browse files Browse the repository at this point in the history
fix: DefaultのshaderをMToonに変更
  • Loading branch information
ayutaz authored Feb 5, 2025
2 parents 926c5cf + 7606204 commit 563cc9f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public float RotationZ
if (_rotationZ < 0) _rotationZ += 360.0f;
}
}

/// <summary>
/// キャラクターのShaderにLilToonを使用するかどうか
/// </summary>
public bool UseLilToon { get; set; } = false;
}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Assets/uDesktopMascot/Scripts/Manager/SystemManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public void DisposeWebServer()
/// </summary>
private void OnDestroy()
{
ApplicationSettings.Instance.SaveSettings();
_cancellationTokenSource?.Cancel();
_cancellationTokenSource?.Dispose();
_webServiceHost?.Dispose();
Expand Down
15 changes: 9 additions & 6 deletions Assets/uDesktopMascot/Scripts/Utility/LoadCharacterModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ public static async UniTask<GameObject> 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;
}

Expand Down

0 comments on commit 563cc9f

Please sign in to comment.