3.0.0-preview.14

# [3.0.0-preview.14](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.13...v3.0.0-preview.14) (2020-08-11)

### Bug Fixes

* read-only properties in the inspector ([f012b23](f012b238d9))
This commit is contained in:
semantic-release-bot
2020-08-11 15:19:14 +00:00
parent e036d254a8
commit 2b3bf91655
3 changed files with 22 additions and 6 deletions

View File

@@ -162,7 +162,10 @@ namespace Coffee.UIExtensions
{
serializedObject.Update();
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(_spParticleSystem);
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel++;
var ps = _spParticleSystem.objectReferenceValue as ParticleSystem;
if (ps)
@@ -170,12 +173,18 @@ namespace Coffee.UIExtensions
var pr = ps.GetComponent<ParticleSystemRenderer>();
var sp = new SerializedObject(pr).FindProperty("m_Materials");
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(0), s_ContentParticleMaterial);
if (2 <= sp.arraySize)
EditorGUI.BeginChangeCheck();
{
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(1), s_ContentTrailMaterial);
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(0), s_ContentParticleMaterial);
if (2 <= sp.arraySize)
{
EditorGUILayout.PropertyField(sp.GetArrayElementAtIndex(1), s_ContentTrailMaterial);
}
}
if (EditorGUI.EndChangeCheck())
{
sp.serializedObject.ApplyModifiedProperties();
}
sp.serializedObject.ApplyModifiedProperties();
if (!Application.isPlaying && pr.enabled)
{
@@ -282,4 +291,4 @@ namespace Coffee.UIExtensions
}
}
}
#endif // [ASMDEFEX] DO NOT REMOVE THIS LINE MANUALLY.
#endif // [ASMDEFEX] DO NOT REMOVE THIS LINE MANUALLY.