void OnPlayerChooseLevel() { // Get the other components on the player to prevent them from moving or doing anything as the scene changes for (int j = 0; j < players.Count; j++) { PlayerThrowing playerThrow = players[j].GetComponent <PlayerThrowing>(); playerThrowingScripts.Add(playerThrow); PlayerHealth health = players[j].GetComponent <PlayerHealth>(); playerHealthScripts.Add(health); } // Lock the player's Movment for (int i = 0; i < players.Count; i++) { playerMovementScripts[i].StopMovementNotCollision(); playerThrowingScripts[i].StopThrowing(); playerHealthScripts[i].StopCatching(); } // Change the scene Fader.instance.FadeToColor(Color.black, delay); Invoke("LoadTheScene", delay + .1f); // Disable the player speach bubbles for (int l = 0; l < playerIndicatorScripts.Count; l++) { playerIndicatorScripts[l].DisableImage(); } //Play level Comfirm Sound fModConfirmLevelEvent.start(); // prevent players from accessing the menu if (interactiveMenuSingleton != null) { interactiveMenuSingleton.DisableMenu(); } completedOnce = true; }
void OnAtCampfire() { SaveLevel(); //onAtCampfire.Invoke(); movingCameraScript.RemoveAllTargets(); movingCameraScript.AddTarget(this.gameObject); // Stop all player movment for (int i = 0; i < players.Count; i++) { playerMovementScripts[i].StopMovement(); playerThrowingScripts[i].StopThrowing(); playerHealthScripts[i].StopCatching(); playerIndicatorScripts[i].StopIndicatorFunctionality(); } buttonPromptText.SetActive(false); // Disable the player speach bubbles for (int l = 0; l < playerIndicatorScripts.Count; l++) { playerIndicatorScripts[l].DisableImage(); playerIndicatorScripts[l].StopIndicatorFunctionality(); } // prevent players from accessing the menu if (interactiveMenuSingleton != null) { interactiveMenuSingleton.DisableMenu(); } CalculateNumberOfPlayersWithCampers(); // Calculate what players have campers //currentState = CampfireState.MovingToDisbandSpot; waitEnum = WaitTime(0.1f, CampfireState.MovingToDisbandSpot); StartCoroutine(waitEnum); }