Nextrek
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
//----------------------------------------------
// NGUI: Next-Gen UI kit
// Copyright © 2011-2013 Tasharen Entertainment
//----------------------------------------------
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(UIButtonColor))]
public class UIButtonColorEditor : UIWidgetContainerEditor
{
public override void OnInspectorGUI ()
{
NGUIEditorTools.SetLabelWidth(80f);
UIButtonColor button = target as UIButtonColor;
GUILayout.Space(6f);
GUI.changed = false;
GameObject tt = (GameObject)EditorGUILayout.ObjectField("Target", button.tweenTarget, typeof(GameObject), true);
if (GUI.changed)
{
NGUIEditorTools.RegisterUndo("Button Change", button);
button.tweenTarget = tt;
UnityEditor.EditorUtility.SetDirty(button);
}
if (tt != null)
{
UIWidget w = tt.GetComponent<UIWidget>();
if (w != null)
{
GUI.changed = false;
Color c = EditorGUILayout.ColorField("Normal", w.color);
if (GUI.changed)
{
NGUIEditorTools.RegisterUndo("Button Change", w);
w.color = c;
UnityEditor.EditorUtility.SetDirty(w);
}
}
}
GUI.changed = false;
Color hover = EditorGUILayout.ColorField("Hover", button.hover);
Color pressed = EditorGUILayout.ColorField("Pressed", button.pressed);
GUILayout.BeginHorizontal();
float duration = EditorGUILayout.FloatField("Duration", button.duration, GUILayout.Width(120f));
GUILayout.Label("seconds");
GUILayout.EndHorizontal();
GUILayout.Space(3f);
if (GUI.changed)
{
NGUIEditorTools.RegisterUndo("Button Change", button);
button.hover = hover;
button.pressed = pressed;
button.duration = duration;
UnityEditor.EditorUtility.SetDirty(button);
}
}
}
|
Revision |
Author |
Commited |
Message |
83
|
FMMortaroli
|
Tue 13 May, 2014 11:32:51 +0000 |
|