Пример #1
0
        public static void Draw(Rect viewRect)
        {
            GUI.Box(viewRect, "");


            GUILayout.BeginArea(viewRect);
            {
                GUILayout.BeginHorizontal();
                GUILayout.Box("", GUILayout.Height(viewRect.height), GUILayout.Width(2));
                if (GUILayout.Button("NEW", GUILayout.Height(viewRect.height), GUILayout.Width(viewRect.height)))
                {
                    NodePopupWindow.Init();
                }
                if (GUILayout.Button("OPEN", GUILayout.Height(viewRect.height), GUILayout.Width(viewRect.height)))
                {
                    DialogGraph.LoadGraph();
                }
                if (GUILayout.Button("RESET POSITION", GUILayout.Height(viewRect.height), GUILayout.Width(viewRect.height * 3)))
                {
                    DialogEditor.Instance.TryResetViewToStartNode();
                }
                if (GUILayout.Button("SAVE", GUILayout.Height(viewRect.height), GUILayout.Width(viewRect.height * 3)))
                {
                    AssetDatabase.SaveAssets();
                    AssetDatabase.Refresh();
                }
                GUILayout.FlexibleSpace();
                GUILayout.Box(Title, GUILayout.Height(viewRect.height), GUILayout.Width(viewRect.height * 4));
                GUILayout.EndHorizontal();
            }
            GUILayout.EndArea();
        }
Пример #2
0
 public static void Init()
 {
     Instance = GetWindow <NodePopupWindow>();
     Instance.titleContent = new GUIContent("Graph Name");
     Instance.maxSize      = new Vector2(300, 80);
     Instance.minSize      = Instance.maxSize;
 }