diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a1d1c9..f41eb95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [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](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/f012b238d97aad3fdc3107b1f9a197de869c43e6)) + # [3.0.0-preview.13](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.12...v3.0.0-preview.13) (2020-08-11) diff --git a/Scripts/Editor/UIParticleEditor.cs b/Scripts/Editor/UIParticleEditor.cs index d659c4a..f343b3b 100644 --- a/Scripts/Editor/UIParticleEditor.cs +++ b/Scripts/Editor/UIParticleEditor.cs @@ -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(); 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. \ No newline at end of file +#endif // [ASMDEFEX] DO NOT REMOVE THIS LINE MANUALLY. diff --git a/package.json b/package.json index 07e08fc..ffb8e86 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.coffee.ui-particle", "displayName": "UI Particle", "description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.", - "version": "3.0.0-preview.13", + "version": "3.0.0-preview.14", "unity": "2018.2", "license": "MIT", "repository": {