void Start() { handler = GetComponentInParent <HR_PlayerHandler>(); bombTimerAudioSource = RCC_CreateAudioSource.NewAudioSource(gameObject, "Bomb Timer AudioSource", 0f, 0f, .25f, bombTimerAudioClip, false, false, false); bombLight = GetComponentInChildren <Light>(); bombLight.enabled = true; bombLight.intensity = 0f; }
void OnPlayerSpawned(HR_PlayerHandler player) { playerCar = player.transform; playerRigid = player.GetComponent <Rigidbody>(); hoodCam = player.GetComponentInChildren <RCC_HoodCamera>(); tpsCam = player.GetComponentInChildren <RCC_TPSCamera>(); if (GameObject.Find("Mirrors")) { mirrors = GameObject.Find("Mirrors").gameObject; } }
void HR_PlayerHandler_OnNearMiss(HR_PlayerHandler player, int score, Side side) { switch (side) { case Side.Left: DisplayScore(score, -75f); break; case Side.Right: DisplayScore(score, 75f); break; case Side.Center: DisplayScore(score, 0f); break; } }
public IEnumerator DisplayResults(HR_PlayerHandler player) { yield return(new WaitForSecondsRealtime(1f)); content.SetActive(true); totalScore.text = Mathf.Floor(player.score).ToString("F0"); totalDistance.text = (player.distance).ToString("F2"); totalNearMiss.text = (player.nearMisses).ToString("F0"); totalOverspeed.text = (player.highSpeedTotal).ToString("F1"); totalOppositeDirection.text = (player.opposideDirectionTotal).ToString("F1"); totalDistanceMoney.text = Mathf.Floor(player.distance * totalDistanceMoneyMP).ToString("F0"); totalNearMissMoney.text = Mathf.Floor(player.nearMisses * totalNearMissMoneyMP).ToString("F0"); totalOverspeedMoney.text = Mathf.Floor(player.highSpeedTotal * totalOverspeedMoneyMP).ToString("F0"); totalOppositeDirectionMoney.text = Mathf.Floor(player.opposideDirectionTotal * totalOppositeDirectionMP).ToString("F0"); totalMoney.text = (Mathf.Floor(player.distance * totalDistanceMoneyMP) + (player.nearMisses * totalNearMissMoneyMP) + Mathf.Floor(player.highSpeedTotal * totalOverspeedMoneyMP) + Mathf.Floor(player.opposideDirectionTotal * totalOppositeDirectionMP)).ToString("F0"); PlayerPrefs.SetInt("Currency", PlayerPrefs.GetInt("Currency", 0) + Mathf.FloorToInt(Mathf.Floor(player.distance * totalDistanceMoneyMP) + (player.nearMisses * totalNearMissMoneyMP) + Mathf.Floor(player.highSpeedTotal * totalOverspeedMoneyMP))); gameObject.BroadcastMessage("Animate"); gameObject.BroadcastMessage("GetNumber"); }
void HR_PlayerHandler_OnPlayerDied(HR_PlayerHandler player) { StartCoroutine(DisplayResults(player)); }
void HR_PlayerHandler_OnPlayerDied(HR_PlayerHandler player) { StartCoroutine(OnGameOver(1f)); }
void HR_PlayerHandler_OnNearMiss(HR_PlayerHandler player, int score, HR_DynamicScoreDisplayer.Side side) { }
void HR_PlayerHandler_OnPlayerSpawned(HR_PlayerHandler player) { gameStarted = false; player.GetComponent <RCC_CarControllerV3> ().canControl = false; StartCoroutine(WaitForGameStart()); }
void OnPlayerSpawned(HR_PlayerHandler player) { handler = player; }
void OnPlayerCrashed(HR_PlayerHandler player) { gameover = true; }