You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
feat: add 'custom view' option.
Use this if the particles are not displayed correctly due to min/max particle size.
This commit is contained in:
@@ -47,6 +47,8 @@ namespace Coffee.UIExtensions
|
||||
private SerializedProperty _groupMaxId;
|
||||
private SerializedProperty _positionMode;
|
||||
private SerializedProperty _autoScalingMode;
|
||||
private SerializedProperty _useCustomView;
|
||||
private SerializedProperty _customViewSize;
|
||||
private ReorderableList _ro;
|
||||
private bool _showMax;
|
||||
|
||||
@@ -82,6 +84,8 @@ namespace Coffee.UIExtensions
|
||||
_groupMaxId = serializedObject.FindProperty("m_GroupMaxId");
|
||||
_positionMode = serializedObject.FindProperty("m_PositionMode");
|
||||
_autoScalingMode = serializedObject.FindProperty("m_AutoScalingMode");
|
||||
_useCustomView = serializedObject.FindProperty("m_UseCustomView");
|
||||
_customViewSize = serializedObject.FindProperty("m_CustomViewSize");
|
||||
|
||||
var sp = serializedObject.FindProperty("m_Particles");
|
||||
_ro = new ReorderableList(sp.serializedObject, sp, true, true, true, true)
|
||||
@@ -201,14 +205,29 @@ namespace Coffee.UIExtensions
|
||||
// Auto Scaling
|
||||
DrawAutoScaling(_autoScalingMode, targets.OfType<UIParticle>());
|
||||
|
||||
// Custom View Size
|
||||
EditorGUILayout.PropertyField(_useCustomView);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUI.BeginDisabledGroup(!_useCustomView.boolValue);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_customViewSize);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUI.EndDisabledGroup();
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
_customViewSize.floatValue = Mathf.Max(0.1f, _customViewSize.floatValue);
|
||||
}
|
||||
|
||||
// Target ParticleSystems.
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUI.BeginDisabledGroup(targets.OfType<UIParticle>().Any(x => !x.canvas));
|
||||
_ro.DoLayoutList();
|
||||
EditorGUI.EndDisabledGroup();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
foreach (var uip in targets.OfType<UIParticle>())
|
||||
{
|
||||
uip.RefreshParticles(uip.particles);
|
||||
|
||||
Reference in New Issue
Block a user