public void OnBtnClick() { switch (btntype) { case BTNMain.New: SceneLoad.LoadSceneHandle("home", 0); Debug.Log("새 게임"); break; case BTNMain.Continue: SceneLoad.LoadSceneHandle("home", 1); Debug.Log("이어하기"); break; case BTNMain.Option: Debug.Log("환경설정"); OptionPanel.SetActive(true); break; case BTNMain.OptionExit: OptionPanel.SetActive(false); break; case BTNMain.Quit: Debug.Log("나가기"); Application.Quit(); break; } }
void OnGUI() { Texture2D tex = new Texture2D(256, 256); ImageConversion.LoadImage(tex, File.ReadAllBytes("icon.png")); GUILayout.BeginHorizontal(); GUILayout.Label(tex); GUILayout.BeginVertical(GUILayout.Height(240)); GUILayout.FlexibleSpace(); GUILayout.Label("HKEdit2 by nes\nAssetsTools by DerPopo\nHollow Knight by Team Cherry"); if (GUILayout.Button("Open a new scene")) { Close(); SceneLoad.CreateScene(); } if (GUILayout.Button("Open an edited scene")) { Close(); SceneLoad.CreateScene(); } if (GUILayout.Button("Close")) { Close(); } GUILayout.EndHorizontal(); }
void Start() { ///< 获取场景切换脚本 sceneload = GameObject.Find("Main Camera").GetComponent<SceneLoad>(); MainCamera = GameObject.Find("Main Camera"); }
void Awake() { m_VideoPlayer = GetComponent <VideoPlayer>(); m_VideoPlayer.loopPointReached += OnMovieFinished; sceneLoad_script = GameObject.FindObjectOfType <SceneLoad>(); }
private void OnGUI() { Texture2D tex = new Texture2D(256, 256); ImageConversion.LoadImage(tex, File.ReadAllBytes("icon.png")); GUILayout.BeginHorizontal(); GUILayout.Label(tex); GUILayout.BeginVertical(GUILayout.Height(240)); GUILayout.FlexibleSpace(); GUILayout.Label("Welcome to HKEdit2!\n\nNew features:\n" + updateFeatures); if (GUILayout.Button("Open a new scene")) { Close(); SceneLoad.CreateScene(); } if (GUILayout.Button("Open an edited scene")) { Close(); SceneLoad.CreateScene(); } if (GUILayout.Button("Settings")) { Close(); } if (GUILayout.Button("Tutorial Playlist")) { Close(); } if (GUILayout.Button("Close")) { Close(); } dontShow = GUILayout.Toggle(dontShow, "Don't show this window again"); GUILayout.EndHorizontal(); }
private static void OnSceneBeingLoaded(SceneOperationKind operation) { var readonlyDict = GetLoadedObjects(operation).ToReadOnlyDictionary(); foreach (var behaviour in _registeredHandlers) { try { behaviour.Key.OnSceneLoad(operation, readonlyDict); } catch (Exception e) { KoikatuAPI.Logger.LogError(e); } } try { SceneLoad?.Invoke(KoikatuAPI.Instance, new SceneLoadEventArgs(operation, readonlyDict)); } catch (Exception e) { KoikatuAPI.Logger.LogError(e); } }
public static void Play() { GfxManager.Load(); AudioManager.Load(); Scene playScene = new PlayScene(); Scene gameOverScene = new GameOverScene(); playScene.NextScene = gameOverScene; gameOverScene.PreviousScene = playScene; CurrScene = playScene; CurrScene.Start(); while (Window.IsOpened) { //float fps = 1 / Window.deltaTime; //Console.SetCursorPosition(0, 0); //if (fps < 59) // Console.Write((1 / Window.deltaTime) + " "); if (Window.GetKey(KeyCode.Esc)) break; if (!CurrScene.IsPlaying) { if (SceneToLoad == SceneLoad.Next) { if (CurrScene.NextScene != null) { CurrScene.OnExit(); CurrScene = CurrScene.NextScene; CurrScene.Start(); } else return; } else { if (CurrScene.PreviousScene != null) { CurrScene.OnExit(); CurrScene = CurrScene.PreviousScene; CurrScene.Start(); SceneToLoad = SceneLoad.Next; } else return; } } CurrScene.Input(); CurrScene.Update(); CurrScene.Draw(); Window.Update(); } }
// 플레이어 사망시 발생하는 루틴 IEnumerator PlayerDie() { yield return(new WaitForSeconds(1f)); GMExists = false; player.PlayerDie(); SceneLoad.LoadSceneHandle("home", 0); Destroy(player.gameObject); Destroy(gameObject); }
public void OnBtnClick() { switch (btntype) { case BTNInGame.Exit: GameObject go = FindObjectOfType <GameManager>().gameObject; GameManager.GMExists = false; Destroy(go); GameObject go2 = FindObjectOfType <Player>().gameObject; Player.playerExists = false; Destroy(go2); MySceneManager.Instance.ChangeScene("StartScene"); break; case BTNInGame.Inventory: activeInventory = !activeInventory; inventoryPanel.SetActive(activeInventory); break; case BTNInGame.Manu: ManuPanel.SetActive(true); break; case BTNInGame.ManuExit: ManuPanel.SetActive(false); break; case BTNInGame.Status: activeStatus = !activeStatus; StatusPanel.SetActive(activeStatus); break; case BTNInGame.Option: OptionPanel.SetActive(true); break; case BTNInGame.OptionExit: OptionPanel.SetActive(false); break; case BTNInGame.Load: GameObject go3 = FindObjectOfType <GameManager>().gameObject; GameManager.GMExists = false; Destroy(go3); GameObject go4 = FindObjectOfType <Player>().gameObject; Player.playerExists = false; Destroy(go4); SceneLoad.LoadSceneHandle("home", 1); break; } }
//Scene currentScene; //float timeDelay=1f; //float currenttime = 0; private void Awake() { Logs.LogD(SceneManager.GetActiveScene().name); GameObject[] objs = GameObject.FindGameObjectsWithTag(this.gameObject.tag); if (objs.Length > 1) { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); instance = this; m_Anim = GetComponent <Animator>(); m_Anim.SetBool("Loading", true); }
void OnGUI() { if (am == null || strings == null || gameDataPath == string.Empty) { return; } Rect scrollViewRect = new Rect(0, 0, position.width, position.height); Rect selectionGridRect = new Rect(0, 0, position.width - 20, strings.Length * 20); scrollPos = GUI.BeginScrollView(scrollViewRect, scrollPos, selectionGridRect); selected = GUI.SelectionGrid(selectionGridRect, selected, strings, 1); GUI.EndScrollView(); if (selected != -1) { string path = Path.Combine(gameDataPath, "level" + selected); SceneLoad.OpenScene(path); selected = -1; } }
private void ChangeToScene(string sceneName, string gateName, float delay = 0f) { if (string.IsNullOrEmpty(sceneName) || string.IsNullOrEmpty(gateName)) { Log("Empty string passed into ChangeToScene, ignoring"); return; } SceneLoad load = ReflectionHelper.GetAttr <GameManager, SceneLoad>(Ref.GM, "sceneLoad"); if (load != null) { load.Finish += () => { LoadScene(sceneName, gateName, delay); }; } else { LoadScene(sceneName, gateName, delay); } }
void Start() { instance = this; // if(startAutomatically) // { // status = FadeStatus.FadeIn; // } // else // { // status = FadeStatus.Paused; // } if (logoPositioning == LogoPositioning.Centered) { splashLogoPos.x = (Screen.width * 0.5f) - (splashLogo.width * 0.5f); splashLogoPos.y = (Screen.height * 0.5f) - (splashLogo.height * 0.5f); splashLogoPos.width = splashLogo.width; splashLogoPos.height = splashLogo.height; } else { splashLogoPos.x = 0; splashLogoPos.y = 0; splashLogoPos.width = Screen.width; splashLogoPos.height = Screen.height; } if (splashType == SplashType.LoadNextLevelThenFadeOut) { DontDestroyOnLoad(this); } if (SceneManager.sceneCount <= 1) { //Debug.LogWarning("Invalid levelToLoad value."); } }
void OnGUI() { if (am == null || strings == null || gameDataPath == string.Empty) { GUILayout.Label("SceneSelector was unloaded. Run Load Scene By Name again."); return; } Rect scrollViewRect = new Rect(0, 0, position.width, position.height); Rect selectionGridRect = new Rect(0, 0, position.width - 20, strings.Length * 20); scrollPos = GUI.BeginScrollView(scrollViewRect, scrollPos, selectionGridRect); selected = GUI.SelectionGrid(selectionGridRect, selected, strings, 1); GUI.EndScrollView(); if (selected != -1) { int oldSelected = selected; selected = -1; //prevent error loop string path = Path.Combine(gameDataPath, "level" + oldSelected); SceneLoad.OpenScene(path); } }
public static void ChangeToScene(string sceneName, string gateName, float delay = 0f) { UIManager.instance.UIClosePauseMenu(); Time.timeScale = 1f; GameManager.instance.FadeSceneIn(); GameManager.instance.isPaused = false; GameCameras.instance.ResumeCameraShake(); if (HeroController.instance != null) { HeroController.instance.UnPause(); } MenuButtonList.ClearAllLastSelected(); TimeController.GenericTimeScale = 1f; GameManager.instance.actorSnapshotUnpaused.TransitionTo(0f); GameManager.instance.ui.AudioGoToGameplay(.2f); if (HeroController.instance != null) { HeroController.instance.UnPause(); } MenuButtonList.ClearAllLastSelected(); PlayerData.instance.atBench = false; // kill bench storage SceneLoad load = ReflectionHelper.GetAttr <GameManager, SceneLoad>(GameManager.instance, "sceneLoad"); if (load != null) { load.Finish += () => { LoadScene(sceneName, gateName, delay); }; } else { LoadScene(sceneName, gateName, delay); } }
public void moveIngame() { SceneLoad.LoadScene("Ingame"); }
public void OnBtnClick() { switch (currentType) { case BTNType.New: SceneLoad.LoadSceneHandle("Stage_1", 1); break; case BTNType.Load: //game.GameLoad(); SceneLoad.LoadSceneHandle(game.gaSc, 2); break; case BTNType.Option: CanvasGroupOn(optionGroup); CanvasGroupOff(mainGroup); break; case BTNType.Sound: if (isSound) { isSound = false; SoundText.text = "Sound Off"; } else { isSound = true; SoundText.text = "Sound On"; } break; case BTNType.Bgm: if (isBgm) { isBgm = false; BgmText.text = "Bgm Off"; } else { isBgm = true; BgmText.text = "Bgm On"; } break; case BTNType.Back: CanvasGroupOn(mainGroup); CanvasGroupOff(optionGroup); break; case BTNType.Main: SceneLoad.LoadSceneHandle("Main", 0); break; case BTNType.Exit: Application.Quit(); break; case BTNType.Restart: //SceneManager를 이용하여 씬을 불러오는데, 현재 씬의 인덱스 번호를 불러와서 현재의 씬을 불러온다. SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); break; } }
public void Start() { // Get scene loader to load next level sceneLoader = FindObjectOfType <SceneLoad>(); }