@@ -41,7 +41,7 @@ public static GUIContent GetContent(string textAndTooltip)
41
41
42
42
#endregion
43
43
44
- public static bool Header ( string title , SerializedProperty group )
44
+ public static bool Header ( string title , SerializedProperty group , Action resetAction )
45
45
{
46
46
var rect = GUILayoutUtility . GetRect ( 16f , 22f , FxStyles . header ) ;
47
47
GUI . Box ( rect , title , FxStyles . header ) ;
@@ -51,12 +51,29 @@ public static bool Header(string title, SerializedProperty group)
51
51
var foldoutRect = new Rect ( rect . x + 4f , rect . y + 2f , 13f , 13f ) ;
52
52
var e = Event . current ;
53
53
54
+ var popupRect = new Rect ( rect . x + rect . width - FxStyles . paneOptionsIcon . width - 5f , rect . y + FxStyles . paneOptionsIcon . height / 2f + 1f , FxStyles . paneOptionsIcon . width , FxStyles . paneOptionsIcon . height ) ;
55
+ GUI . DrawTexture ( popupRect , FxStyles . paneOptionsIcon ) ;
56
+
54
57
if ( e . type == EventType . Repaint )
55
58
FxStyles . headerFoldout . Draw ( foldoutRect , false , false , display , false ) ;
56
59
57
60
if ( e . type == EventType . MouseDown )
58
61
{
59
- if ( rect . Contains ( e . mousePosition ) )
62
+ if ( popupRect . Contains ( e . mousePosition ) )
63
+ {
64
+ var popup = new GenericMenu ( ) ;
65
+ popup . AddItem ( GetContent ( "Reset" ) , false , ( ) => resetAction ( ) ) ;
66
+ popup . AddSeparator ( string . Empty ) ;
67
+ popup . AddItem ( GetContent ( "Copy Settings" ) , false , ( ) => CopySettings ( group ) ) ;
68
+
69
+ if ( CanPaste ( group ) )
70
+ popup . AddItem ( GetContent ( "Paste Settings" ) , false , ( ) => PasteSettings ( group ) ) ;
71
+ else
72
+ popup . AddDisabledItem ( GetContent ( "Paste Settings" ) ) ;
73
+
74
+ popup . ShowAsContext ( ) ;
75
+ }
76
+ else if ( rect . Contains ( e . mousePosition ) && group != null )
60
77
{
61
78
display = ! display ;
62
79
0 commit comments