From 4e048ff93c22aff448da34c892d606fa8c84b72d Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Fri, 15 Feb 2019 20:48:10 +0900 Subject: [PATCH] fix #148; UIEffectCapturedImage.effectColor does not work as expected --- .../UIEffect/Scripts/Editor/UIEffectCapturedImageEditor.cs | 2 +- .../UIExtensions/UIEffect/Scripts/Editor/UIEffectEditor.cs | 4 ++-- .../UIExtensions/UIEffect/Scripts/UIEffectCapturedImage.cs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectCapturedImageEditor.cs b/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectCapturedImageEditor.cs index 3ea4fbe..f3840dd 100644 --- a/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectCapturedImageEditor.cs +++ b/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectCapturedImageEditor.cs @@ -70,7 +70,7 @@ namespace Coffee.UIExtensions.Editors //================ GUILayout.Space(10); EditorGUILayout.LabelField("Capture Effect", EditorStyles.boldLabel); - UIEffectEditor.DrawEffectProperties(serializedObject); + UIEffectEditor.DrawEffectProperties(serializedObject, "m_EffectColor"); //================ // Advanced option. diff --git a/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectEditor.cs b/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectEditor.cs index ae673f5..2a74a10 100644 --- a/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectEditor.cs +++ b/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIEffectEditor.cs @@ -20,7 +20,7 @@ namespace Coffee.UIExtensions.Editors /// /// Draw effect properties. /// - public static void DrawEffectProperties(SerializedObject serializedObject) + public static void DrawEffectProperties(SerializedObject serializedObject, string colorProperty = "m_Color") { //================ // Effect material. @@ -55,7 +55,7 @@ namespace Coffee.UIExtensions.Editors { EditorGUI.indentLevel++; - SerializedProperty spColor = serializedObject.FindProperty("m_Color"); + SerializedProperty spColor = serializedObject.FindProperty(colorProperty); if (spColor == null && serializedObject.targetObject is UIEffect) { spColor = new SerializedObject (serializedObject.targetObjects.Select(x=>(x as UIEffect).targetGraphic).ToArray()).FindProperty("m_Color"); } diff --git a/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIEffectCapturedImage.cs b/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIEffectCapturedImage.cs index a7969d9..9ecdd33 100644 --- a/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIEffectCapturedImage.cs +++ b/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIEffectCapturedImage.cs @@ -254,7 +254,7 @@ namespace Coffee.UIExtensions base.OnPopulateMesh(vh); int count = vh.currentVertCount; UIVertex vt = default(UIVertex); - Color c = new Color(1, 1, 1, color.a); + Color c = color; for (int i = 0; i < count; i++) { vh.PopulateUIVertex(ref vt, i); @@ -541,6 +541,7 @@ namespace Coffee.UIExtensions { if (obj) { + obj.Release(); RenderTexture.ReleaseTemporary (obj); obj = null; }