Skip to content

Commit

Permalink
fix: mainTex will be ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Sep 29, 2024
1 parent 2c1ac4b commit 2ee69d0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Packages/src/Runtime/UIParticleRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ internal class UIParticleRenderer : MaskableGraphic
private static readonly CombineInstance[] s_CombineInstances = { new CombineInstance() };
private static readonly List<Material> s_Materials = new List<Material>(2);
private static MaterialPropertyBlock s_Mpb;
private static readonly List<Color32> s_Colors = new List<Color32>();
private static readonly Vector3[] s_Corners = new Vector3[4];
private bool _delay;
private int _index;
Expand Down Expand Up @@ -189,7 +188,6 @@ public override Material GetModifiedMaterial(Material baseMaterial)
if (!IsActive() || !_parent)
{
MaterialRepository.Release(ref _modifiedMaterial);
_modifiedMaterial = null;
return baseMaterial;
}

Expand All @@ -215,10 +213,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;
Expand Down

0 comments on commit 2ee69d0

Please sign in to comment.