From b630ddce5e9e2bbb4056e34fc80e5bd81b0db20e Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Mon, 13 Jul 2020 18:04:10 -0700 Subject: [PATCH] Fix texture initialization --- .../Plugins/ConformalDecals.dll | Bin 45056 -> 45056 bytes .../MaterialTextureProperty.cs | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/GameData/ConformalDecals/Plugins/ConformalDecals.dll index 452eaacdfe0e74b93cb92dfda7039d9816a5d2c3..18cfcb8512560ad687df7b2ce05b97586f70fa74 100644 GIT binary patch delta 501 zcmZp8z|`=7X+j4}&8_8sCiciMdQDsz&iH*YBcnR&pCb$mA(IuEbS6hKsxwARZe*+% z)IP=l1|C3?iGh`&V6z}ovN_|P$)%RF6qu@$7#LVYH0&4{xOAkLn5tueTwQhzdqxH> zZB`BD&Fof2OpIldU2Uv3H`rJRg<3>_3_He9E8oqylHm=M_mjJuaTSAOBuK7};XdnU zuGI`)P~IlCUtDV#V&FV(?zId@z`ThJY8;~6>lqR!^ZL6c*GGYMORN-SW!TLy6U=+a zxSxZOVGqL`C@)ja5Xj?>2C00=`A%jM;~oZK2#?WB8l+MRDrYY14CJXm?r7ODs4mZ{nfN2Gh0(7~ZNgZ)9Nf4PXM=&;Y~% zM}c@bkO2jZKw21x)q(f|Q0~HH(dEhlss3-2&T{{7>Zp=fbEs+KiOC+zi;bXyNhhF! zAft_I^H-awE~{De`HiDIG-5y|TY}gM6BWf6wKub@c*nSzZ`ChmCLgoSg6rNhPBdT# E01)eom;e9( delta 483 zcmZp8z|`=7X+j6f9NiB+6MJMB^(L+iXS_X`kx`xX!4U?AkjaWnI+G(A)fsIjH!{`> z@*iUW0}mj{#K6iBvRRNR*_?68db2Rx>C;d7IdNajju6f%CYz*D}lj z^CmK=afouSXRw^C>F=7H6b05Tu~L+kVK+k!nD>xzKL;bj9)<=eFH_DC$a@dralVt8 z#JGpyJ5_cRL)%18OY;^2ATPg(NNTcdk=&6=8OJ?LX0Mxos)hV3oL!PBVo>j zQm0KW%xi3aQdR+x$G 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()); }