Last active
January 18, 2024 06:42
-
-
Save Flattan/a305a2194775e170e35051112faaa7d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
public class EditorOpimize : EditorWindow | |
{ | |
//選択された進行状態 | |
public GameState selectedState; | |
//ゲーム開始後、指定の進行状態へ移動するためのフラグ | |
private bool isJump = false; | |
[MenuItem("Extension/JumpWindow", false, 1)] | |
private static void ShowWindow() | |
{ | |
EditorOpimize window = GetWindow<EditorOpimize>(); | |
window.titleContent = new GUIContent("Jump Window"); | |
} | |
private void OnGUI() | |
{ | |
this.selectedState = (GameController.GameStoryState)EditorGUILayout.EnumPopup("Game State", this.selectedState); | |
if (GUILayout.Button("Jump To " + selectedState)) | |
{ | |
EditorSceneManager.OpenScene("Assets/Scenes/TitleScene.unity"); | |
EditorApplication.isPlaying = true; | |
this.isJump = true; | |
} | |
if (this.isJump && EditorApplication.isPlaying) | |
{ | |
WholeGameController.instance.ContinueGame(selectedState); | |
this.isJump = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment