fix #148; UIEffectCapturedImage.effectColor does not work as expected

This commit is contained in:
mob-sakai
2019-02-15 20:48:10 +09:00
parent f119ca608b
commit 4e048ff93c
3 changed files with 5 additions and 4 deletions
@@ -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.
@@ -20,7 +20,7 @@ namespace Coffee.UIExtensions.Editors
/// <summary>
/// Draw effect properties.
/// </summary>
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");
}
@@ -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;
}