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 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; }
protected virtual IEnumerator LoadNextLevel() { yield return(new WaitForSeconds(_delayAfterClick)); GameManager.Instance.SelfDestruction(); LoadingSceneManager.LoadScene(NextLevel); }
public void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { LoadingSceneManager.LoadScene(num); } }
// 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 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"); }
private void EnterSub() { Debug.Log("Enter Sub"); MMGameEvent.Trigger("Save"); CorgiEngineEvent.Trigger(CorgiEngineEventTypes.LevelEnd); LoadingSceneManager.LoadScene("base"); }
public void ChangeInGameScene(int stageLevel) { string sceneName = "InGameScene"; string level = stageLevel.ToString(); LoadingSceneManager.LoadScene(sceneName + level); }
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"); }
/// <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); } }
void Update() { if (Input.GetMouseButtonDown(0)) { LoadingSceneManager.LoadScene(SceneName.MenuSceneName); } }
private void Update() { if (Input.anyKey) { Destroy(FollowerInventory.Instance.gameObject); LoadingSceneManager.LoadScene("1-Childhood"); } }
public void BackLobby() { if (!UserInfoManager.instance.isLobby) { mapInfo = null; LoadingSceneManager.LoadScene("Lobby"); } }
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"); }
/// <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); } }
public void ChangeSceneWithLoading(string scene_name) { Common.SoundManager.Instance.StopBGM(); LoadingSceneManager.LoadScene(scene_name); if (AlchemyPlanet.TownScene.UIManager.Instance) { AlchemyPlanet.TownScene.UIManager.Instance.Clear(); } }
public void sceneChange() { if (PlayerPrefs.HasKey("Name")) { LoadingSceneManager.LoadScene(2); } else { LoadingSceneManager.LoadScene(1); } }
/// <summary> /// Loads the next level /// </summary> public virtual void GoToNextLevel() { if (LevelManager.Instance != null) { LevelManager.Instance.GotoLevel(LevelName); } else { LoadingSceneManager.LoadScene(LevelName); } }
/// <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); } }
//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); }
/// <summary> /// Loads the next scene after having stored the selected character in the Game Manager. /// </summary> public virtual void LoadNextScene() { StoreCharacterSelection(); if (LevelManager.Instance != null) { LevelManager.Instance.GotoLevel(DestinationSceneName); } else { LoadingSceneManager.LoadScene(DestinationSceneName); } }
IEnumerator NextStage() { _delay = 0; while (_delay < 15f) { _delay += Time.deltaTime; yield return(null); } LoadingSceneManager.LoadScene("공대관", "LoadingScreen"); yield break; }
/// <summary> /// Loads the next scene after having stored the selected character in the Game Manager. /// </summary> public virtual void LoadNextScene() { StoreCharacterSelection(); LoadingSceneManager.LoadScene(DestinationSceneName); /*if (LevelManager.Instance != null) * { * LevelManager.Instance.GotoLevel(DestinationSceneName); * } * else * { * }*/ }
public void load_game() { key_ok = true; load_ob.SetActive(false); if (die) { game_Over.restart(); } Load_nodie.instance.num = click_num; Load_nodie.instance.load_on = true; LoadingSceneManager.LoadScene("Game_SceneNew"); }
/// <summary> /// If we're in game over state, checks for input and restarts the game if needed /// </summary> protected virtual void CheckForGameOver() { if (_gameOver) { if ((Input.GetButton("Player1_Jump")) || (Input.GetButton("Player2_Jump")) || (Input.GetButton("Player3_Jump")) || (Input.GetButton("Player4_Jump"))) { MMTimeScaleEvent.Trigger(MMTimeScaleMethods.Reset, 1f, 0f, false, 0f, true); LoadingSceneManager.LoadScene(SceneManager.GetActiveScene().name); } } }
/*void Update() * { * * }*/ private void OnTriggerEnter(Collider other) { Npc npc = other.gameObject.GetComponent <Npc>(); //if (npc == null) // return; if (other.tag == "NPC") { dialBtn.gameObject.SetActive(true); npcNum = npc.npcNum; } //시티에서 필드로 이동 트리거 if (SceneManager.GetActiveScene().name == "CityScene" && other.tag == "FieldGate") { //SceneManager.LoadScene("FieldScene"); LoadingSceneManager.LoadScene("FieldScene"); isFieldToCity = false; isCityToField = true; } //필드에서 시티로 이동 트리거 if (SceneManager.GetActiveScene().name == "FieldScene" && other.tag == "CityGate") { //SceneManager.LoadScene("CityScene"); LoadingSceneManager.LoadScene("CityScene"); isCityToField = false; isFieldToCity = true; } //아이템, 골드 드랍 획득 if (SceneManager.GetActiveScene().name == "FieldScene" && other.tag == "Gold") { int goldAdd = Random.Range(350, 500); goldRetrun += goldAdd; print("소지금 : " + gold); Destroy(other.gameObject); } if (SceneManager.GetActiveScene().name == "FieldScene" && other.tag == "Item") { //퀘스트 아이템 검사 int slotNum = Random.Range(0, 3); print("아이템 드랍"); inven.DropItem(qiSlot[slotNum].GetComponent <Slot>().item); //qItemList.OnDrop(qiSlot[slotNum].GetComponent<Slot>()); Destroy(other.gameObject); } }
IEnumerator FadeOut() { float fade = 0; while (fade <= 1) { fade += 0.01f; FadeOutImg.color = new Color(1, 1, 1, fade); // Debug.Log("페이드 아웃중"+fade); yield return(null); } yield return(new WaitForSeconds(0.5f)); LoadingSceneManager.LoadScene("Main_menu"); }