You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
@@ -62,6 +62,7 @@ namespace Coffee.UIExtensions
|
|||||||
private SerializedProperty m_MeshSharing;
|
private SerializedProperty m_MeshSharing;
|
||||||
private SerializedProperty m_GroupId;
|
private SerializedProperty m_GroupId;
|
||||||
private SerializedProperty m_GroupMaxId;
|
private SerializedProperty m_GroupMaxId;
|
||||||
|
private SerializedProperty m_AbsoluteMode;
|
||||||
|
|
||||||
|
|
||||||
private ReorderableList _ro;
|
private ReorderableList _ro;
|
||||||
@@ -150,6 +151,7 @@ namespace Coffee.UIExtensions
|
|||||||
m_MeshSharing = serializedObject.FindProperty("m_MeshSharing");
|
m_MeshSharing = serializedObject.FindProperty("m_MeshSharing");
|
||||||
m_GroupId = serializedObject.FindProperty("m_GroupId");
|
m_GroupId = serializedObject.FindProperty("m_GroupId");
|
||||||
m_GroupMaxId = serializedObject.FindProperty("m_GroupMaxId");
|
m_GroupMaxId = serializedObject.FindProperty("m_GroupMaxId");
|
||||||
|
m_AbsoluteMode = serializedObject.FindProperty("m_AbsoluteMode");
|
||||||
|
|
||||||
var sp = serializedObject.FindProperty("m_Particles");
|
var sp = serializedObject.FindProperty("m_Particles");
|
||||||
_ro = new ReorderableList(sp.serializedObject, sp, true, true, true, true);
|
_ro = new ReorderableList(sp.serializedObject, sp, true, true, true, true);
|
||||||
@@ -265,6 +267,9 @@ namespace Coffee.UIExtensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absolute Mode
|
||||||
|
EditorGUILayout.PropertyField(m_AbsoluteMode);
|
||||||
|
|
||||||
// Target ParticleSystems.
|
// Target ParticleSystems.
|
||||||
_ro.DoLayoutList();
|
_ro.DoLayoutList();
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ namespace Coffee.UIExtensions
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private int m_GroupMaxId = 0;
|
private int m_GroupMaxId = 0;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
[Tooltip("The particles will be emitted at the ParticleSystem position.\nMove the UIParticle/ParticleSystem to move the particle.")]
|
||||||
|
private bool m_AbsoluteMode = false;
|
||||||
|
|
||||||
private List<UIParticleRenderer> m_Renderers = new List<UIParticleRenderer>();
|
private List<UIParticleRenderer> m_Renderers = new List<UIParticleRenderer>();
|
||||||
|
|
||||||
#if !SERIALIZE_FIELD_MASKABLE
|
#if !SERIALIZE_FIELD_MASKABLE
|
||||||
@@ -112,6 +116,17 @@ namespace Coffee.UIExtensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Absolute particle position mode.
|
||||||
|
/// The particles will be emitted at the ParticleSystem position.
|
||||||
|
/// Move the UIParticle/ParticleSystem to move the particle.
|
||||||
|
/// </summary>
|
||||||
|
public bool absoluteMode
|
||||||
|
{
|
||||||
|
get { return m_AbsoluteMode; }
|
||||||
|
set { m_AbsoluteMode = value; }
|
||||||
|
}
|
||||||
|
|
||||||
internal bool useMeshSharing
|
internal bool useMeshSharing
|
||||||
{
|
{
|
||||||
get { return m_MeshSharing != MeshSharing.None; }
|
get { return m_MeshSharing != MeshSharing.None; }
|
||||||
|
|||||||
@@ -249,7 +249,15 @@ namespace Coffee.UIExtensions
|
|||||||
Profiler.BeginSample("[UIParticleRenderer] Combine Mesh");
|
Profiler.BeginSample("[UIParticleRenderer] Combine Mesh");
|
||||||
if (_parent.canSimulate)
|
if (_parent.canSimulate)
|
||||||
{
|
{
|
||||||
s_CombineInstances[0].transform = canvasRenderer.transform.worldToLocalMatrix * GetWorldMatrix(psPos, scale);
|
if (_parent.absoluteMode)
|
||||||
|
{
|
||||||
|
s_CombineInstances[0].transform = canvasRenderer.transform.worldToLocalMatrix * GetWorldMatrix(psPos, scale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var diff = _particleSystem.transform.position - _parent.transform.position;
|
||||||
|
s_CombineInstances[0].transform = canvasRenderer.transform.worldToLocalMatrix * Matrix4x4.Translate(diff.GetScaled(scale - Vector3.one)) * GetWorldMatrix(psPos, scale);
|
||||||
|
}
|
||||||
workerMesh.CombineMeshes(s_CombineInstances, true, true);
|
workerMesh.CombineMeshes(s_CombineInstances, true, true);
|
||||||
|
|
||||||
workerMesh.RecalculateBounds();
|
workerMesh.RecalculateBounds();
|
||||||
|
|||||||
Reference in New Issue
Block a user