public void FinishLevel() { player.GetLevelStats().SetStat(LevelRewards.ConditionType.Time, Time.timeSinceLevelLoad); LevelRewards levelRewards = GameObject.Find("HUD").transform.Find("LevelRewards").GetComponent <LevelRewards>(); rewardsPassable = levelRewards.Save(); ResetCar(); if (nextLevel > PlayerPrefs.GetInt("CurrentLevel")) { PlayerPrefs.SetInt("CurrentLevel", nextLevel); } SceneManager.LoadScene("LevelComplete", LoadSceneMode.Single); }
public void Load(LevelRewardsPassable source) { rewardOneCondition = source.rewardOneCondition; rewardOneComparison = source.rewardOneComparison; rewardOneValue = source.rewardOneValue; rewardOnePrefab = source.rewardOnePrefab; rewardTwoCondition = source.rewardTwoCondition; rewardTwoComparison = source.rewardTwoComparison; rewardTwoValue = source.rewardTwoValue; rewardTwoPrefab = source.rewardTwoPrefab; rewardThreeCondition = source.rewardThreeCondition; rewardThreeComparison = source.rewardThreeComparison; rewardThreeValue = source.rewardThreeValue; rewardThreePrefab = source.rewardThreePrefab; }