private async void UpdateParkedTime() { if (ParkingGameSettings.GameMode == GameMode.FirstToPark) { parkedTime += Time.deltaTime; GameState.TimeInParkingSpot = parkedTime; GameState.PlayerInParkingSpot = PhotonNetwork.LocalPlayer.NickName; } else if (ParkingGameSettings.GameMode == GameMode.KingOfTheHill) { PlayerProperties.PlayerScore += 1; } if (parkedTime > ParkingGameSettings.VictoryCountdown && ParkingGameSettings.GameMode == GameMode.FirstToPark && running && GameState.ParkingSpotsLeft > 0) { running = false; photonView.RPC("SuspendParkingCountdownText", RpcTarget.All, 5000); parkingLotManager.GenerateNewParkingSpot(); if (ParkingGameSettings.GameMode == GameMode.FirstToPark) { PlayerProperties.PlayerScore = 100 * (GameState.ParkingSpotsLeft / ParkingGameSettings.NumberOfTimesParkingSpotMoves); GameObject oldPlayerCar = MultiplayerPlayer.LocalPlayer; oldPlayerCar.GetComponent <PhotonView>().RPC("DisableCar", RpcTarget.All); SpawnPlayerAsNPC(); } await Task.Delay(1000); GameState.ParkingSpotsLeft -= 1; running = true; } else if (parkedTime > ParkingGameSettings.VictoryCountdown && running && GameState.ParkingSpotsLeft == 0) { running = false; PhotonNetwork.RaiseEvent(EventCodes.Victory, PhotonNetwork.LocalPlayer, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); } }