mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
Update ShaderReplacer.cs
This commit is contained in:
parent
4c03f8c9fc
commit
ab95b419aa
@ -1,5 +1,4 @@
|
|||||||
using QSB.Utility;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace QSB.PlayerBodySetup.Remote;
|
namespace QSB.PlayerBodySetup.Remote;
|
||||||
|
|
||||||
@ -13,8 +12,6 @@ public static class ShaderReplacer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ReplaceShaders(GameObject prefab)
|
public static void ReplaceShaders(GameObject prefab)
|
||||||
{
|
{
|
||||||
DebugLog.DebugWrite($"Processing shaders for {prefab.name}...", OWML.Common.MessageType.Info);
|
|
||||||
|
|
||||||
foreach (var renderer in prefab.GetComponentsInChildren<Renderer>(true))
|
foreach (var renderer in prefab.GetComponentsInChildren<Renderer>(true))
|
||||||
{
|
{
|
||||||
foreach (var material in renderer.sharedMaterials)
|
foreach (var material in renderer.sharedMaterials)
|
||||||
@ -24,17 +21,9 @@ public static class ShaderReplacer
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (material.shader == null)
|
|
||||||
{
|
|
||||||
DebugLog.ToConsole($"Warning - Shader for material {material.name} is null.", OWML.Common.MessageType.Warning);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var replacementShader = Shader.Find(material.shader.name);
|
var replacementShader = Shader.Find(material.shader.name);
|
||||||
|
|
||||||
if (replacementShader == null)
|
if (replacementShader == null)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Warning - Replacement shader found for shader {material.shader.name} was null. Sticking with the original.", OWML.Common.MessageType.Warning);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user