Пример #1
0
        protected static bool AltLayoutF(System.Action action, string label, EditorSavingBool open, bool box = false, GUIStyle style = null)
        {
            bool openValue = open;

            LayoutF(action, label, ref openValue, box, style);
            bool result = open.Value == openValue;

            open.Value = openValue;
            return(result);
        }
Пример #2
0
 protected static void LayoutF(System.Action action, string label, EditorSavingBool open, bool box = false, GUIStyle style = null)
 {
     LayoutV(() => {
         open.Value = GUILayout.Toggle(
             open,
             label,
             GUI.skin.GetStyle("foldout"),
             GUILayout.ExpandWidth(true),
             GUILayout.Height(18)
             );
         if (open)
         {
             action();
         }
     }, box, style);
     Space(4);
 }
Пример #3
0
 protected static void AltLayoutF(System.Action action, string label, EditorSavingBool open, bool box = false, GUIStyle style = null)
 {
     LayoutV(() => {
         if (box)
         {
             style = GUI.skin.box;
         }
         Rect rect  = GUIRect(0, 18);
         rect.x    -= style == null ? 18 : style.padding.left;
         open.Value = GUI.Toggle(
             rect,
             open,
             label,
             GUI.skin.GetStyle("foldout")
             );
         if (open)
         {
             action();
         }
     }, box, style);
     Space(4);
 }