private IEnumerator LoadNextScene() { yield return(new WaitForSeconds(5f)); playerPrefs.SetGameMoney(Mathf.FloorToInt(playerScore)); FindObjectOfType <LevelControl>().LoadNextLevel(); }
// Use this for initialization void Start() { playerPrefs = FindObjectOfType <PlayerPrefsControlScript>(); gameScore = playerPrefs.GetGameMoney(); currentScore = playerPrefs.GetCurrentGameMoney(); currentScore += gameScore; earned = GameObject.Find("Txt_GameScore").GetComponent <Text>(); total = GameObject.Find("Txt_CurrentGameScore").GetComponent <Text>(); earned.text = gameScore.ToString(); total.text = currentScore.ToString(); playerPrefs.SetAccumalitiveMoney(playerPrefs.GetAccumalitiveMoney() + gameScore); gameScore = 0; playerPrefs.SetGameMoney(gameScore); playerPrefs.SetCurrentGameMoney(currentScore); evSystem = FindObjectOfType <EventSystem>(); }