void ChangeScene(SceneNumber SNumber) { switch (SNumber) { case SceneNumber.EMPTY: number = SNumber; break; case SceneNumber.Z_TO_PLAY: //シーン遷移 SceneManager.LoadScene("Play"); break; case SceneNumber.Z_TO_MAIN: //シーン遷移 SceneManager.LoadScene("Main"); break; case SceneNumber.SPACE_TO_MENU: //シーン遷移 SceneManager.LoadScene("Menu"); break; case SceneNumber.X_TO_MAIN: //シーン遷移 SceneManager.LoadScene("Main"); break; default: number = SNumber; break; } }
IEnumerator fadeImage(SceneNumber SNumber) { //フェードイン if (alpha <= 1) { fade.color = new Color(fade.color.r, fade.color.g, fade.color.b, alpha); alpha += 0.01f; yield return(1); } //フェードインが終わったら if (alpha > 1) { //シーン遷移関数 ChangeScene(SNumber); } }
void SceneBotton() { //Zキーでシーン遷移起動 if (Input.GetKeyDown(KeyCode.Z) && SceneName == "Main") { number = SceneNumber.Z_TO_PLAY; } else if (Input.GetKeyDown(KeyCode.Z) && SceneName == "Play") { number = SceneNumber.Z_TO_MAIN; } //Spaceキーでシーン遷移起動 else if (Input.GetKeyDown(KeyCode.Space) && SceneName == "Main") { number = SceneNumber.SPACE_TO_MENU; } //Xキーでシーン遷移起動 else if (Input.GetKeyDown(KeyCode.X) && SceneName == "Menu") { number = SceneNumber.X_TO_MAIN; } }
public void ChanageScene(SceneNumber nextScene) { //StartCoroutine(FadeOut()); SceneManager.LoadScene(nextScene.ToString()); //StartCoroutine(FadeIn()); }
public void Init() { currentScene = SceneNumber.Title; }
private SceneNumber portalTargetScene; // 이동할 씬 // 프로퍼티 셋 public void SetProp(TextPrinter textPrinter, ConverseSelection converseSelection, SceneNumber sceneNumber) { textPrinterWindow = textPrinter; converseSelectionWindow = converseSelection; portalTargetScene = sceneNumber; }