예제 #1
0
        private void importLevel()
        {
            // check to see if there was an existing level, as we'll have to overwrite it
            GameObject existingLevel = GameObject.Find("Level");

            if (existingLevel)
            {
                bool yes = EditorUtility.DisplayDialog("Existing level",
                                                       "There is an existing level loaded. Are you sure you " +
                                                       "want to import another level? Any unsaved changes will " +
                                                       "be lost.", "Yes", "Cancel");
                if (!yes)
                {
                    return;
                }
            }

            string levelPath = CommonGUI.BrowseForFile("Import level...",
                                                       new[] { "Level files", "tmap,json" }, null);

            if (levelPath == null)
            {
                return;
            }

            EditLevel(levelPath);
        }
예제 #2
0
        private void drawFirstDream(int i)
        {
            EditorGUILayout.BeginHorizontal();
            _journal.FirstDream[i] = EditorGUILayout.TextField(
                new GUIContent("", "The path to a dream that you should start on in this journal."),
                _journal.FirstDream[i]);
            if (GUILayout.Button("Browse", GUILayout.Width(60)))
            {
                _journal.FirstDream[i] = CommonGUI.BrowseForFile("Browse for dream", new[] { "Dream JSON file", "json" },
                                                                 _journal.FirstDream[i]);
            }

            if (GUILayout.Button("Remove", GUILayout.Width(60)))
            {
                _firstDreamsToRemove.Push(i);
            }

            EditorGUILayout.EndHorizontal();
        }