From 2ee69d04245fabce185f67dc9bd68c870e556564 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Mon, 30 Sep 2024 02:35:13 +0900 Subject: [PATCH] fix: mainTex will be ignored --- Packages/src/Runtime/UIParticleRenderer.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Packages/src/Runtime/UIParticleRenderer.cs b/Packages/src/Runtime/UIParticleRenderer.cs index 38bf1e9..53a060b 100644 --- a/Packages/src/Runtime/UIParticleRenderer.cs +++ b/Packages/src/Runtime/UIParticleRenderer.cs @@ -24,7 +24,6 @@ namespace Coffee.UIExtensions private static readonly CombineInstance[] s_CombineInstances = { new CombineInstance() }; private static readonly List s_Materials = new List(2); private static MaterialPropertyBlock s_Mpb; - private static readonly List s_Colors = new List(); private static readonly Vector3[] s_Corners = new Vector3[4]; private bool _delay; private int _index; @@ -189,7 +188,6 @@ namespace Coffee.UIExtensions if (!IsActive() || !_parent) { MaterialRepository.Release(ref _modifiedMaterial); - _modifiedMaterial = null; return baseMaterial; } @@ -215,10 +213,11 @@ namespace Coffee.UIExtensions ); if (!MaterialRepository.Valid(hash, _modifiedMaterial)) { - MaterialRepository.Get(hash, ref _modifiedMaterial, () => new Material(modifiedMaterial) + MaterialRepository.Get(hash, ref _modifiedMaterial, x => new Material(x.mat) { - hideFlags = HideFlags.HideAndDontSave - }); + hideFlags = HideFlags.HideAndDontSave, + mainTexture = x.texture ? x.texture : x.mat.mainTexture + }, (mat: modifiedMaterial, texture)); } return _modifiedMaterial;