IEnumerator EndMiniGamePlayer1() { player1PreAnimated.gameObject.SetActive(true); player1.position = new Vector3(1000, 1000, 1000); elevator.SetTrigger("Animate"); yield return(new WaitForSeconds(0.5f)); dude.SetTrigger("EnterExit"); yield return(new WaitForSeconds(0.5f)); elevator.SetTrigger("Animate"); yield return(new WaitForSeconds(0.5f)); elevator.SetTrigger("Fade"); camera.SetTrigger("Animate"); rooms.SetTrigger("Animate"); // room leave tower1Meter.SetTrigger("Animate"); player1Floor++; if (PM.IsLocalClient(player1.GetComponent <PhotonView>())) { MusicManager.ElevatorMusic(); } yield return(new WaitForSeconds(0.2f)); if (player1Floor == 4) // 3 is max, so if we go one more we won { StartCoroutine(LoadRoofPlayer1()); if (playerID == 1) { isGameOver = true; PM.SaveData("isGameOver", true); PM.SaveData("player1WinTime", playerTime); hud.enabled = false; StartCoroutine(PlayAgainDelay()); } playerTimeText.text = "YOUR TIME: " + playerTime; opponentTimeText.text = "OPPONENT TIME: " + opponentTime; GetComponent <PhotonView>().RPC("GetPlayerWinTime", RpcTarget.All); } else { StartCoroutine(LoadNextRoomPlayer1()); } if (player1Floor == 4) { } }
// Update is called once per frame void Update() { if (PM.CurrentServerUserDepth == PhotonArenaManager.ServerDepthLevel.InRoom && isSpawned == false) { player = PM.SpawnPlayer(PlayerSpawn.transform.position, PlayerSpawn.transform.rotation, "Character 3D Online"); isSpawned = true; } if (PM.CurrentServerUserDepth == PhotonArenaManager.ServerDepthLevel.InRoom && _isFooblesSpawned == false) { if (PM.GetData("_IsFooblesSpawned") == null || ((bool)PM.GetData("_IsFooblesSpawned") == false)) { PM.SpawnObject("FoobleOnline", FooblesSpawn.transform.position, FooblesSpawn.transform.rotation); PM.SaveData("_IsFooblesSpawned", true); _isFooblesSpawned = true; } } // if (Photon.Pun.PunRP) // { // } }