Last active
April 10, 2022 22:11
-
-
Save Skyzi000/2d5f728f02c656743af190dd5e50a491 to your computer and use it in GitHub Desktop.
SRDebugger LoadSceneOption - BuildSettingsの全てのシーンにワンタップで切り替え
This file contains hidden or 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
public static class SRDebuggerLoadSceneOption | |
{ | |
#if !DISABLE_SRDEBUGGER | |
[UnityEngine.RuntimeInitializeOnLoadMethod(UnityEngine.RuntimeInitializeLoadType.BeforeSceneLoad)] | |
private static void AddLoadSceneOptions() | |
{ | |
for (var i = 0; i < UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings; i++) | |
{ | |
var buildIndex = i; | |
var option = SRDebugger.OptionDefinition.FromMethod( | |
System.IO.Path.GetFileNameWithoutExtension(UnityEngine.SceneManagement.SceneUtility.GetScenePathByBuildIndex(buildIndex)), () => | |
UnityEngine.SceneManagement.SceneManager.LoadScene(buildIndex), "LoadScene"); | |
SRDebug.Instance.AddOption(option); | |
} | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment