Skip to content

Commit

Permalink
fix _Color warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
katycat5e committed Feb 6, 2025
1 parent ff4d666 commit 8f1aa2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SkinManagerMod/TextureUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public static void ApplyTextures(MeshRenderer renderer, Skin skin, CarMaterialDa
var skinTexture = skin.GetTexture(defaultTexture.TextureName)!;
renderer.material.SetTexture(defaultTexture.PropertyName, skinTexture.TextureData);

if (defaultTexture.PropertyName == PropNames.Main)
if ((defaultTexture.PropertyName == PropNames.Main) && renderer.material.HasProperty("_Color"))
{
renderer.material.color = Color.white;
}
Expand All @@ -351,7 +351,7 @@ public static void ApplyTextures(MeshRenderer renderer, Skin skin, CarMaterialDa
var skinTexture = defaultMaterial.GetTexture(defaultTexture.PropertyName);
renderer.material.SetTexture(defaultTexture.PropertyName, skinTexture);

if (defaultTexture.PropertyName == PropNames.Main)
if ((defaultTexture.PropertyName == PropNames.Main) && renderer.material.HasProperty("_Color"))
{
// demo bogies et al. don't have textures...
renderer.material.color = defaultMaterial.color;
Expand Down

0 comments on commit 8f1aa2f

Please sign in to comment.