public void LevelComplete() { DisablePlayer(); // Fade out screen canvasFader.Fade(CanvasFader.FadeType.OUT); if (LevelCompletedEvent != null) { LevelCompletedEvent(currentLevel); } int levelIndex = currentLevel.Number + 1; if (levelIndex == maxLevels - 1) // last level is special final level { // Load final level with non-collapsing universe- don't call BeginShrinking() StartCoroutine(DelayedLoadLevel(levelIndex)); //SpawnPlayer(currentLevel.Universe.Respawn); Debug.Log("Game Complete!"); if (GameCompletedEvent != null) { GameCompletedEvent(); } return; } // Unload previous and then load the new level StartCoroutine(DelayedLoadLevel(levelIndex)); }
private IEnumerator EnterCombatRoutine() { MyMap.SetCharactersMovement(false); MyFader.SetText(PlayerCharacter.name + "\n-= VS =-\n" + GetNextCharacter().name); OnEnterCombat.Invoke(); // play music MyFader.ReverseFade(); yield return(new WaitForSeconds(1f)); // Turn off all characters // turn off cavearea if (CaveLevel) { CaveLevel.SetActive(false); } // turn on combat area gameObject.SetActive(true); // reposition things! for (int i = 0; i < Spawners.Count; i++) { Spawners[i].Teleport(CombatCharacters[i]); } yield return(new WaitForSeconds(0.1f)); MyFader.Fade(); yield return(new WaitForSeconds(1f)); SetButtonsInteractable(true); AttackingCharacterLabel.text = PlayerCharacter.name; EnterCombatRountine = null; }
private IEnumerator MyWholeLife() { cf.Fade(true, 1); yield return(new WaitForSeconds(4)); cf.Fade(false, .5f); yield return(new WaitForSeconds(2f)); Destroy(gameObject); }
public IEnumerator TransitionToMainMenu() { cf.Fade(false, 2); yield return(new WaitForSeconds(0.8f)); SceneManager.LoadScene("MainMenu"); }
public IEnumerator OnTrialBegin(NeuroTag tag) { // If it is the first step, show the Neurotag first if (currentStep == 0) { yield return StartCoroutine(preCalibrationGroup.Fade(0)); yield return StartCoroutine(ShowTransform(neuroTagGroup, true)); } }
private IEnumerator Start() { // Set the initial alpha to start off with a black screen. StartCoroutine(sceneScreenFader.Fade(1f, 0f)); if (!playerSaveData) { Debug.LogWarning("No PlayerSaveData Asset attached to SceneController."); } else if (!initialStartingPositionName.Equals("")) { // Write the initial starting position to the playerSaveData so it can be loaded by the player when the first scene is loaded. playerSaveData.Save(StartingPosition.startingPositionKey, initialStartingPositionName); } // Start the first scene loading and wait for it to finish. yield return(StartCoroutine(FadeAndSwitchScenes(startingSceneName))); // Once the scene is finished loading, start fading in. StartCoroutine(sceneScreenFader.Fade(0f)); }
void Start() { buttonsAndTitleCF.Fade(true, 2); welcomeText.text = $"Welcome, {GameManager.user.username}!"; e1pos = new Vector3(-356, 62, -5); e1rot = new Quaternion(-0.03201738f, 0.06985322f, 0.05429835f, 0.9955637f); e2pos = new Vector3(-528.95f, -69.2f, -12.39f); e2rot = new Quaternion(0.04392721f, 0.03913203f, 0.1983917f, 0.9783557f); StartCoroutine(AnimateEmbellishments()); PhotonNetwork.ConnectUsingSettings(); savedRoomList = new List <RoomInfo>(); }
private void ShowStore() { store.SetActive(true); cf.Fade(true, 2); }