예제 #1
0
        public void OnGUI(Func <Rect> drawAction)
        {
            IsMouseUp     = Event.current.type == EventType.MouseUp;
            HoveredObject = null;

            try
            {
                currentRect = drawAction();
            }
            catch (GUIExpireException exception)
            {
                GUIClipStack.PopAll();
                exception.Process();
            }
        }
예제 #2
0
        public void FullDraw()
        {
            GUIStyles.OnGUI();

            if (!Selector)
            {
                Selector = ScriptableObject.CreateInstance <DataSelector>();
            }

            if (EditorUtility.scriptCompilationFailed)
            {
                EditorGUILayout.HelpBox("Has compilation errors", MessageType.Error);
            }

            if (FileSystemTracker.Instance.HasChanges)
            {
                EditorGUILayout.HelpBox("Has changes on disk", MessageType.Warning);
            }

            UnityEngine.GUI.enabled = !Application.isPlaying && !EditorUtility.scriptCompilationFailed;
            Layout.BeginHorizontal();
            Layout.Button("Save", GameState.Instance.SaveDatabase, GUILayout.Width(100));
            Layout.Button("Load", GameState.Instance.ReloadDatabase, GUILayout.Width(100));
            Layout.EndHorizontal();
            UnityEngine.GUI.enabled = true;

            ScrollPosition = GUIClipStack.BeginScroll(ScrollPosition, GUIStyles.DarkGrayBackground);

            var gameData = GameState.Instance.GameData;

            if (gameData != null)
            {
                DrawFolderContent(gameData.RootFolder);
            }
            GUIClipStack.End();
        }