public override bool OnClickBeginEvent() { HUDManager.GetInstance.Deactivate = HUDManager.HUDState.GameResult; LoadingSceneManager.LoadCurrentScene(); return(true); }
/// <summary> /// Waits for a short time and then loads the specified level /// </summary> /// <returns>The level co.</returns> /// <param name="levelName">Level name.</param> protected virtual IEnumerator GotoLevelCo(string levelName) { if (Players != null && Players.Count > 0) { foreach (Character player in Players) { player.Disable(); } } if (Time.timeScale > 0.0f) { yield return(new WaitForSeconds(OutroFadeDuration)); } // we trigger an unPause event for the GameManager (and potentially other classes) MMEventManager.TriggerEvent(new CorgiEngineEvent(CorgiEngineEventTypes.UnPause)); if (string.IsNullOrEmpty(levelName)) { LoadingSceneManager.LoadScene("StartScreen"); } else { LoadingSceneManager.LoadScene(levelName); } }
public void ChangeInGameScene(int stageLevel) { string sceneName = "InGameScene"; string level = stageLevel.ToString(); LoadingSceneManager.LoadScene(sceneName + level); }
protected override IEnumerator EventRoutine() { /// 플레이어에게 이동 yield return(StartCoroutine(MoveToPlayerRoutine())); Talk(false); yield return(WaitUntillTalkEnd()); string pokemon = "C++"; _pokemonSelector._pokemonRegisterAction.AddListener((data) => { pokemon = data; }); _pokemonSelector.StartSelecting(); yield return(WaitUntilSelectEnd()); PokemonBattleManager.Instance.StartBattle(pokemon, "동방컴"); yield return(WaitUntilBattleEnd()); List <DialoguePage> textPages = new List <DialoguePage>(); textPages.Add(DialoguePage.CreatePage("코딩하느라 고생했어. 와! 정말 잘 만들었는걸")); textPages.Add(DialoguePage.CreatePage("잠시 의자에 앉아서 기다려줄래? 지원서를 찾아야해서")); textPages.Add(DialoguePage.CreatePage("뭐? 관심없다고? 에이 팅기지말고 기다려봐")); _textPages = textPages; Talk(false); yield return(WaitUntillTalkEnd()); yield return(new WaitForSeconds(1f)); LoadingSceneManager.LoadScene("동방"); yield break; }
public void LoadScene() { // 현 상태에 따라 씬을 불러내는 함수. switch (curState) { case State.start: //게임 시작 시 세이브 파일 초기화. SaveFile(); curState = State.tutorial; objectflag = false; LoadingSceneManager.LoadScene("Selling"); break; case State.selling: curState = State.market; SceneManager.LoadScene("Market"); break; case State.market: curState = State.selling; SceneManager.LoadScene("Selling"); break; case State.Ending: curState = State.start; // 게임 오버 후 처음 화면으로 돌아갈 때 게임을 초기화함. InitGame(); SceneManager.LoadScene("Start"); break; } }
protected virtual IEnumerator LoadNextLevel() { yield return(new WaitForSeconds(_delayAfterClick)); GameManager.Instance.SelfDestruction(); LoadingSceneManager.LoadScene(NextLevel); }
public void ClickExit() { CloseMenu(); theTitleUIManager = FindObjectOfType <TitleUIManager>(); Destroy(theTitleUIManager.gameObject); LoadingSceneManager.SetLoadScene("GameTitle"); }
// Update is called once per frame void Update() { if (player.isPlaying && !havePlayed) { havePlayed = true; } if (player.time >= (videoLength - 1) && !haveAlreadyFade) { GetComponent <VideoFadeEffect>().FadeOut(); haveAlreadyFade = true; } if (!player.isPlaying && !player.clip.name.Equals("outro") && havePlayed) { videoCamera.SetActive(false); global.SetActive(true); main.GetComponent <CameraController>().enabled = true; havePlayed = false; } else if (!player.isPlaying && player.clip.name.Equals("outro") && havePlayed) { if (SceneManager.GetActiveScene().name == "Tutorial") { GetComponent <VideoFadeEffect>().FadeOut(); LoadingSceneManager.LoadScene("LevelSelection"); } videoCamera.SetActive(false); GameObject.FindGameObjectWithTag("endPoint").GetComponent <EndLevelTrigger>().ActionOnTrigger(); havePlayed = false; } }
IEnumerator Dissolve() { goalCamera.transform.position = new Vector3(-51.45f, 34.89f, -9.82f); goalCamera.transform.rotation = Quaternion.Euler(0, -90.0f, 0); disapearParticle.Play(); float value = 0.0f; while (value < 1.0f) { foreach (var mat in materials) { mat.SetFloat("_SliceAmount", value); value += 0.003f; } yield return(new WaitForSeconds(0.4f)); } disapearParticle.Stop(); goalCamera.enabled = false; yield return(new WaitForSeconds(4.0f)); LoadingSceneManager.LoadScene("Credit"); }
private void EnterSub() { Debug.Log("Enter Sub"); MMGameEvent.Trigger("Save"); CorgiEngineEvent.Trigger(CorgiEngineEventTypes.LevelEnd); LoadingSceneManager.LoadScene("base"); }
IEnumerator SizeUp() { ParticleSystem ps = GroundFX.GetComponent <ParticleSystem>(); ParticleSystem.MainModule module = ps.main; float size = 0.0f; while (ps.main.startSize.constant < 4.5f) { size += 0.15f; module.startSize = size; yield return(new WaitForSeconds(0.1f)); } GroundFX.GetComponent <ParticleSystem>().Stop(); ParticleFX.GetComponent <ParticleSystem>().Stop(); player.GetComponent <Player>().InteractPanelOff(); if (player.GetComponent <MagnetController>().IronObject != null) { player.GetComponent <MagnetController>().IronObject.Clear(); } if (player.GetComponent <MagnetController>().IronDoor != null) { player.GetComponent <MagnetController>().IronDoor.Clear(); } LoadingSceneManager.LoadScene("Zelda_Dgn"); }
public void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { LoadingSceneManager.LoadScene(num); } }
void Update() { if (Input.GetMouseButtonDown(0)) { LoadingSceneManager.LoadScene(SceneName.MenuSceneName); } }
// ******************************************************************** // Function: LoadScene() // Purpose: Loads the supplied scene // ******************************************************************** public IEnumerator LoadSceneAsync(string sceneName) { // Fade to black yield return(StartCoroutine(m_blackScreenCover.FadeIn())); // Load loading screen yield return(Application.LoadLevelAsync("LoadingScreen")); // !!! unload old screen (automatic) // Fade to loading screen yield return(StartCoroutine(m_blackScreenCover.FadeOut())); float endTime = Time.time + m_minDuration; // Load level async yield return(Application.LoadLevelAdditiveAsync(sceneName)); while (Time.time < endTime) { yield return(null); } // Play music or perform other misc tasks // Fade to black yield return(StartCoroutine(m_blackScreenCover.FadeIn())); // !!! unload loading screen LoadingSceneManager.UnloadLoadingScene(); // Fade to new screen yield return(StartCoroutine(m_blackScreenCover.FadeOut())); }
protected virtual IEnumerator RealDead() //죽고나서 5초뒤에 시체가 사라지면서 마을로 이동 { float Color = 0; yield return(null); do { Color += Time.smoothDeltaTime * 1.0f; SkinnedMeshRenderer[] Meshes = GetComponentsInChildren <SkinnedMeshRenderer>(); for (int i = 0; i < Meshes.Length; ++i) { Material[] materials = Meshes[i].materials; for (int j = 0; j < materials.Length; ++j) { materials[j].SetFloat("_DissolveAmount", Color); } } } while (Color < 1); if (Color >= 1) { LoadingSceneManager.LoadingScene("TownScene"); } }
public IEnumerator TutorialEnd() { GameObject.Find("Kira").GetComponent <MeshRenderer>().enabled = true; yield return(new WaitForSeconds(2f)); Quest_clear_system.instance.clear_trigger[11]++; LoadingSceneManager.LoadScene("Game_SceneNew"); }
public void BackLobby() { if (!UserInfoManager.instance.isLobby) { mapInfo = null; LoadingSceneManager.LoadScene("Lobby"); } }
private void Update() { if (Input.anyKey) { Destroy(FollowerInventory.Instance.gameObject); LoadingSceneManager.LoadScene("1-Childhood"); } }
/// <summary> /// Coroutine that kills the player, stops the camera, resets the points. /// </summary> /// <returns>The player co.</returns> protected virtual IEnumerator SoloModeRestart() { if ((PlayerPrefabs.Count() <= 0) && (SceneCharacters.Count <= 0)) { yield break; } // if we've setup our game manager to use lives (meaning our max lives is more than zero) if (GameManager.Instance.MaximumLives > 0) { // we lose a life GameManager.Instance.LoseLife(); // if we're out of lives, we check if we have an exit scene, and move there if (GameManager.Instance.CurrentLives <= 0) { TopDownEngineEvent.Trigger(TopDownEngineEventTypes.GameOver, null); if ((GameManager.Instance.GameOverScene != null) && (GameManager.Instance.GameOverScene != "")) { LoadingSceneManager.LoadScene(GameManager.Instance.GameOverScene); } } } MMCameraEvent.Trigger(MMCameraEventTypes.StopFollowing); MMFadeInEvent.Trigger(OutroFadeDuration, FadeCurve, FaderID, true, Players[0].transform.position); yield return(new WaitForSeconds(OutroFadeDuration)); yield return(new WaitForSeconds(RespawnDelay)); GUIManager.Instance.SetPauseScreen(false); GUIManager.Instance.SetDeathScreen(false); MMFadeOutEvent.Trigger(OutroFadeDuration, FadeCurve, FaderID, true, Players[0].transform.position); MMCameraEvent.Trigger(MMCameraEventTypes.StartFollowing); if (CurrentCheckpoint == null) { CurrentCheckpoint = InitialSpawnPoint; } if (Players[0] == null) { InstantiatePlayableCharacters(); } if (CurrentCheckpoint != null) { CurrentCheckpoint.SpawnPlayer(Players[0]); } _started = DateTime.UtcNow; // we send a new points event for the GameManager to catch (and other classes that may listen to it too) TopDownEnginePointEvent.Trigger(PointsMethods.Set, 0); TopDownEngineEvent.Trigger(TopDownEngineEventTypes.RespawnComplete, Players[0]); yield break; }
public void GameOver() { if (currentHp <= 30) { print("HP : " + currentHp); LoadingSceneManager.LoadScene("Fail"); Debug.Log("사망하였습니다."); } }
// 박스 콜라이더에 닿는 순간 이벤트 발생 private void OnTriggerStay2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player") && Input.GetKeyDown(KeyCode.S)) { LoadingSceneManager.LoadScene(transferMapName); collision.gameObject.transform.position = new Vector2(25, 0); } }
private void OnTriggerEnter(Collider other) { if (this.transform.localScale.x > 3) { if (other.CompareTag("Player")) { LoadingSceneManager.LoadingScene(SceneName); } } }
public void ChangeSceneWithLoading(string scene_name) { Common.SoundManager.Instance.StopBGM(); LoadingSceneManager.LoadScene(scene_name); if (AlchemyPlanet.TownScene.UIManager.Instance) { AlchemyPlanet.TownScene.UIManager.Instance.Clear(); } }
/// <summary> /// /// </summary> void Update() { if (_loading) { if (_fader.FadeOutEnded) { LoadingSceneManager.LoadLevel(_nextLevelName); } return; } if (Input.anyKeyDown) { if (Input.GetButton("Attack")) { Load(); return; } else if (Input.GetButton("Jump")) { return; } else if (Input.GetButton("Dash")) { Load("Title"); return; } if (Input.GetKey(KeyCode.UpArrow)) { ChangeItem(-1, 0); } else if (Input.GetKey(KeyCode.DownArrow)) { ChangeItem(1, 0); } else if (Input.GetKey(KeyCode.LeftArrow)) { ChangeItem(0, -1); } else if (Input.GetKey(KeyCode.RightArrow)) { ChangeItem(0, 1); } } foreach (GameObject stagePoint in _stagePoints) { Debug.DrawRay(_earth.transform.position, stagePoint.transform.position); } }
public void sceneChange() { if (PlayerPrefs.HasKey("Name")) { LoadingSceneManager.LoadScene(2); } else { LoadingSceneManager.LoadScene(1); } }
/// <summary> /// Loads the scene specified in the inspector /// </summary> public virtual void LoadSceneProcess() { if (LoadingSceneMode == LoadingSceneModes.UnityNative) { SceneManager.LoadScene(SceneName); } if (LoadingSceneMode == LoadingSceneModes.MMLoadingSceneManager) { LoadingSceneManager.LoadScene(SceneName); } }
/// <summary> /// Loads the next level /// </summary> public virtual void GoToNextLevel() { if (LevelManager.Instance != null) { LevelManager.Instance.GotoLevel(LevelName, (DelayBeforeTransition == 0f)); } else { LoadingSceneManager.LoadScene(LevelName); } }
/// <summary> /// Loads the next level /// </summary> public virtual void GoToNextLevel() { if (LevelManager.Instance != null) { LevelManager.Instance.GotoLevel(LevelName); } else { LoadingSceneManager.LoadScene(LevelName); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { if (Name != null) { MemoryPoolManager.Instance.MemoryDelete(); PlayerIO.SaveData(); LoadingSceneManager.LoadingScene(Name); } } }
//Play Button public void StartLevel(int num) { if (num < 0 || num >= SceneManager.sceneCountInBuildSettings) { Debug.LogWarning("Can't load scene num " + num + "SceneManager only has " + SceneManager.sceneCountInBuildSettings + "scenes in Build Settings"); return; } LoadingSceneManager.LoadScene(num); DontDestroyOnLoad(optionsMenu); }
void Awake() { m_instence = this; }