Skip to content

Instantly share code, notes, and snippets.

@Flattan
Last active January 18, 2024 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Flattan/a305a2194775e170e35051112faaa7d0 to your computer and use it in GitHub Desktop.
Save Flattan/a305a2194775e170e35051112faaa7d0 to your computer and use it in GitHub Desktop.
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