mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-21 02:12:37 +08:00
fix #148; UIEffectCapturedImage.effectColor does not work as expected
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user