fix build error and something
parent
97ea668294
commit
8e1b4eb086
|
@ -252,7 +252,7 @@ namespace Coffee.UIExtensions
|
||||||
RefreshParticles(gameObject);
|
RefreshParticles(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RefreshParticles(GameObject root)
|
private void RefreshParticles(GameObject root)
|
||||||
{
|
{
|
||||||
if (!root) return;
|
if (!root) return;
|
||||||
root.GetComponentsInChildren(particles);
|
root.GetComponentsInChildren(particles);
|
||||||
|
@ -304,6 +304,8 @@ namespace Coffee.UIExtensions
|
||||||
|
|
||||||
internal void UpdateRenderers()
|
internal void UpdateRenderers()
|
||||||
{
|
{
|
||||||
|
if (!isActiveAndEnabled) return;
|
||||||
|
|
||||||
var bakeCamera = GetBakeCamera();
|
var bakeCamera = GetBakeCamera();
|
||||||
for (var i = 0; i < m_Renderers.Count; i++)
|
for (var i = 0; i < m_Renderers.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -328,7 +330,15 @@ namespace Coffee.UIExtensions
|
||||||
_tracker.Add(this, rectTransform, DrivenTransformProperties.Scale);
|
_tracker.Add(this, rectTransform, DrivenTransformProperties.Scale);
|
||||||
UIParticleUpdater.Register(this);
|
UIParticleUpdater.Register(this);
|
||||||
RegisterDirtyMaterialCallback(UpdateRendererMaterial);
|
RegisterDirtyMaterialCallback(UpdateRendererMaterial);
|
||||||
RefreshParticles(particles);
|
|
||||||
|
if (0 < particles.Count)
|
||||||
|
{
|
||||||
|
RefreshParticles(particles);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RefreshParticles();
|
||||||
|
}
|
||||||
|
|
||||||
base.OnEnable();
|
base.OnEnable();
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,17 +113,18 @@ namespace Coffee.UIExtensions
|
||||||
_particleSystem = null;
|
_particleSystem = null;
|
||||||
_renderer = null;
|
_renderer = null;
|
||||||
_prevParticleCount = 0;
|
_prevParticleCount = 0;
|
||||||
if (0 <= index )
|
if (0 <= index)
|
||||||
{
|
{
|
||||||
_index = index;
|
_index = index;
|
||||||
}
|
}
|
||||||
//_emitter = null;
|
//_emitter = null;
|
||||||
|
if (this && isActiveAndEnabled)
|
||||||
material = null;
|
{
|
||||||
enabled = false;
|
material = null;
|
||||||
|
workerMesh.Clear();
|
||||||
workerMesh.Clear();
|
canvasRenderer.SetMesh(workerMesh);
|
||||||
canvasRenderer.SetMesh(workerMesh);
|
enabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(UIParticle parent, ParticleSystem particleSystem, bool isTrail)
|
public void Set(UIParticle parent, ParticleSystem particleSystem, bool isTrail)
|
||||||
|
@ -171,7 +172,7 @@ namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
// No particle to render: Clear mesh.
|
// No particle to render: Clear mesh.
|
||||||
if (
|
if (
|
||||||
!enabled || !_particleSystem || !_parent || !canvasRenderer || !canvas || !bakeCamera
|
!isActiveAndEnabled || !_particleSystem || !_parent || !canvasRenderer || !canvas || !bakeCamera
|
||||||
|| _parent.meshSharing == UIParticle.MeshSharing.Reprica
|
|| _parent.meshSharing == UIParticle.MeshSharing.Reprica
|
||||||
|| !transform.lossyScale.GetScaled(_parent.scale3D).IsVisible() // Scale is not visible.
|
|| !transform.lossyScale.GetScaled(_parent.scale3D).IsVisible() // Scale is not visible.
|
||||||
|| (!_particleSystem.IsAlive() && !_particleSystem.isPlaying) // No particle.
|
|| (!_particleSystem.IsAlive() && !_particleSystem.isPlaying) // No particle.
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace Coffee.UIExtensions
|
||||||
s_UpdatedGroupIds.Clear();
|
s_UpdatedGroupIds.Clear();
|
||||||
|
|
||||||
// Attract
|
// Attract
|
||||||
for(var i = 0;i< s_ActiveAttractors.Count;i++)
|
for (var i = 0; i < s_ActiveAttractors.Count; i++)
|
||||||
{
|
{
|
||||||
s_ActiveAttractors[i].Attract();
|
s_ActiveAttractors[i].Attract();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue