@@ -41,7 +41,7 @@ public static GUIContent GetContent(string textAndTooltip)
4141
4242 #endregion
4343
44- public static bool Header ( string title , SerializedProperty group )
44+ public static bool Header ( string title , SerializedProperty group , Action resetAction )
4545 {
4646 var rect = GUILayoutUtility . GetRect ( 16f , 22f , FxStyles . header ) ;
4747 GUI . Box ( rect , title , FxStyles . header ) ;
@@ -51,12 +51,29 @@ public static bool Header(string title, SerializedProperty group)
5151 var foldoutRect = new Rect ( rect . x + 4f , rect . y + 2f , 13f , 13f ) ;
5252 var e = Event . current ;
5353
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+
5457 if ( e . type == EventType . Repaint )
5558 FxStyles . headerFoldout . Draw ( foldoutRect , false , false , display , false ) ;
5659
5760 if ( e . type == EventType . MouseDown )
5861 {
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 )
6077 {
6178 display = ! display ;
6279
0 commit comments