From 8311c6bb11c901fca57f991650a03e3969611c2a 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/src/Runtime/UIParticleRenderer.cs b/Packages/src/Runtime/UIParticleRenderer.cs index 38bf1e9..f03a095 100644 --- a/Packages/src/Runtime/UIParticleRenderer.cs +++ b/Packages/src/Runtime/UIParticleRenderer.cs @@ -189,7 +189,6 @@ public override Material GetModifiedMaterial(Material baseMaterial) if (!IsActive() || !_parent) { MaterialRepository.Release(ref _modifiedMaterial); - _modifiedMaterial = null; return baseMaterial; } @@ -215,10 +214,11 @@ public override Material GetModifiedMaterial(Material baseMaterial) ); 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;