mob-sakai 2024-06-27 16:47:14 +09:00
parent e96b1dc7c0
commit 68c066e58c
4 changed files with 14 additions and 20 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3e440931f761e4e888510a4e6045287a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -125,7 +125,8 @@ _This package requires **Unity 2018.3 or later**._
- The default value of `UIParticle.scale` has been changed from `10` to `1`.
- `UIParticle` no longer inherits from `MaskableGraphic`.
-
- Add project settings for UIParticle
- enableLinearToGamma: Enables LinearToGamma during mesh baking
<br><br>

View File

@ -522,6 +522,7 @@ namespace Coffee.UIExtensions
var go = transform.GetChild(i).gameObject;
if (go.TryGetComponent<Camera>(out var cam) && cam == _bakeCamera) continue;
if (go.TryGetComponent<UIParticleRenderer>(out var _)) continue;
go.SetActive(false);
if (destroyOldParticles)
{

View File

@ -25,7 +25,6 @@ namespace Coffee.UIExtensions
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<UIParticleRenderer> s_Renderers = new List<UIParticleRenderer>(8);
private static readonly Vector3[] s_Corners = new Vector3[4];
private bool _delay;
private int _index;
@ -445,22 +444,25 @@ namespace Coffee.UIExtensions
// Get grouped renderers.
Profiler.BeginSample("[UIParticleRenderer] Set Mesh");
s_Renderers.Clear();
var renderers = ListPool<UIParticleRenderer>.Rent();
if (_parent.useMeshSharing)
{
UIParticleUpdater.GetGroupedRenderers(_parent.groupId, _index, s_Renderers);
UIParticleUpdater.GetGroupedRenderers(_parent.groupId, _index, renderers);
}
for (var i = 0; i < s_Renderers.Count; i++)
for (var i = 0; i < renderers.Count; i++)
{
if (s_Renderers[i] == this) continue;
var r = renderers[i];
if (r == this) continue;
s_Renderers[i].canvasRenderer.SetMesh(workerMesh);
s_Renderers[i]._lastBounds = _lastBounds;
s_Renderers[i].canvasRenderer.materialCount = 1;
s_Renderers[i].canvasRenderer.SetMaterial(materialForRendering, 0);
r.canvasRenderer.SetMesh(workerMesh);
r._lastBounds = _lastBounds;
r.canvasRenderer.materialCount = 1;
r.canvasRenderer.SetMaterial(materialForRendering, 0);
}
ListPool<UIParticleRenderer>.Return(ref renderers);
if (_parent.canRender)
{
canvasRenderer.SetMesh(workerMesh);
@ -471,8 +473,6 @@ namespace Coffee.UIExtensions
}
Profiler.EndSample();
s_Renderers.Clear();
}
public override void SetMaterialDirty()