Exemplo n.º 1
0
        // Invoked when GUI is repainted
        void OnGUI()
        {
            if (Instance == null)
            {
                Instance = GetWindow(typeof(LevelEditorWindow))
                           as LevelEditorWindow;
            }

            if (LevelManager.Instance == null)
            {
                return;
            }

            // If not connected to LM, attempt to do so
            if (!Application.isPlaying &&
                (!levelManager || !LevelManager.Instance.IsConnectedToEditor) &&
                LevelManager.Instance != null)
            {
                ConnectToLevelManager();
            }

            // Draw window GUI
            DrawLevelEditorGUI();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets and shows the instance of the editor window.
 /// </summary>
 //[MenuItem("Level Editor/Editor Window")]
 public static void ShowWindow()
 {
     Instance = GetWindow(typeof(LevelEditorWindow))
                as LevelEditorWindow;
     Instance.minSize = new Vector2(MIN_WINDOW_WIDTH, 100f);
 }