diff --git a/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/GameData/ConformalDecals/Plugins/ConformalDecals.dll index 9386ae9..429bcc4 100644 --- a/GameData/ConformalDecals/Plugins/ConformalDecals.dll +++ b/GameData/ConformalDecals/Plugins/ConformalDecals.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f79052b6a482ee65c85deb7ce55d67b6b2353f34b67ea30d2fe9677498cca4f6 +oid sha256:5b9c33ef108042edb665edc7b7f143f9ecc35d2524a7a6c7df9b144690d1c471 size 45056 diff --git a/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs b/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs index 1cc683e..4ae0692 100644 --- a/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs +++ b/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs @@ -10,7 +10,7 @@ namespace ConformalDecals.MaterialProperties { [SerializeField] public bool autoTile; [SerializeField] private string _textureUrl; - [SerializeField] private Texture2D _texture = Texture2D.whiteTexture; + [SerializeField] private Texture2D _texture; [SerializeField] private bool _hasTile; [SerializeField] private Rect _tileRect; @@ -55,6 +55,10 @@ namespace ConformalDecals.MaterialProperties { if (ParseUtil.ParseStringIndirect(ref _textureUrl, node, "textureUrl")) { _texture = LoadTexture(_textureUrl, isNormal); } + + if (_texture == null) { + _texture = isNormal ? DecalConfig.BlankNormal : Texture2D.whiteTexture; + } } public override void Modify(Material material) { @@ -73,7 +77,7 @@ namespace ConformalDecals.MaterialProperties { public override void Remove(Material material) { if (material == null) throw new ArgumentNullException(nameof(material)); base.Remove(material); - + if (_propertyName != "_Decal") material.DisableKeyword("DECAL" + _propertyName.ToUpper()); }