public IEnumerator Transition(string newSceneName, BirthPointType birthPoint) { var options = SceneManager.LoadSceneAsync(newSceneName); options.allowSceneActivation = false; while (!options.isDone) { if (options.progress >= 0.9f) { options.allowSceneActivation = true; } if (!m_IsTransitioning) { m_IsTransitioning = true; yield return(Instance.StartCoroutine(SceneFader.FadeSceneIn(SceneFader.FadeType.Loading))); } else { yield return(null); } } Player.Instance.Redirect(birthPoint); yield return(StartCoroutine(SceneFader.FadeSceneOut())); m_IsTransitioning = false; }
public static void Encount(List <EncountEnemy> enemies, Sprite backGroundImage = null, AudioClip bgm = null, bool canEscape = true) { Instance.canEscape = canEscape; Instance.backGroundImage = backGroundImage; Instance.enemyGroups = enemies; SetEncounterSteps(); Instance.StartCoroutine(SceneFader.FadeSceneOut()); SceneController.Transition("Battle"); }
public void RandamEncounter() { Encounter encounter = Encounter.Instance; encounter.backGroundImage = backGroundImage; encounter.enemyGroups = GetEncountEnemy(); EncounterController.SetEncounterSteps(); SceneFader.FadeSceneOut(); SceneController.Instance.Transition("Battle"); }
public void FadeOut() { StartCoroutine(Fade()); IEnumerator Fade() { yield return(StartCoroutine(SceneFader.FadeSceneOut())); LuaScript.instance.Resume(); yield break; } }
public static void Encount(int id) { Encounter encounter = Encounter.Instance; //encounter.backGroundImage = backGroundImage; EnemyData enemyData = GameController.Instance.enemyMasterData.characterData.First(x => x.id == id); encounter.enemyGroups = new List <EncountEnemy>() { new EncountEnemy() { enemy = enemyData, posiiton = 0 } }; EncounterController.SetEncounterSteps(); SceneFader.FadeSceneOut(); SceneController.Instance.Transition("Battle"); }
public IEnumerator Talk() { MessageWindow messageWindow = MessageSystem.GetWindow(); ChoiceWindow choiceWindow = MessageSystem.GetChoise(); InteractableStart(); yield return(StartCoroutine(messageWindow.ShowClick("ひと晩" + roomCharge + "ゴールドですが\nおとまりになられますか"))); yield return(StartCoroutine(choiceWindow.Choice())); int choiceResult = choiceWindow.Result(); if (choiceResult == 1) { if (GameController.Instance.money <= 0) { yield return(StartCoroutine(messageWindow.ShowClick("お金が たりないようです"))); messageWindow.Close(); InteractableEnd(); yield break; } yield return(StartCoroutine(messageWindow.ShowClick("それでは ごゆっくり おやすみください"))); GameController.Instance.money -= roomCharge; Stay(); yield return(StartCoroutine(SceneFader.FadeSceneOut())); yield return(StartCoroutine(SceneFader.FadeSceneIn())); yield return(StartCoroutine(messageWindow.ShowClick("おはようございます。ではいってらっしゃいませ"))); } else { yield return(StartCoroutine(messageWindow.ShowClick("お気をつけて 旅をつづけられますように"))); } messageWindow.Close(); InteractableEnd(); yield break; }