// Start is called before the first frame update private void Start() { PlayerPrefs.SetInt("TopSpeed1", 0); PlayerPrefs.SetInt("MaintainSpeed1", 0); PlayerPrefs.SetInt("RacePlacement1", 0); PlayerPrefs.SetInt("TotalDistance1", 0); PlayerPrefs.SetInt("DailiesCompleted", 0); tsc01 = new TopSpeed(topSpeedImage, 20); msc01 = new MaintainSpeed(maintainSpeedImage, 10, 30); rpc01 = new RacePlacement(racePlacementImage, 3); tdc01 = new TotalDistance(totalDistanceImage, 2); dcc01 = new DailiesCompleted(dailiesCompletedImage); }
IEnumerator RacePlacementTrigger(RacePlacement challenge) { PlayerPrefs.SetInt("RacePlacement1", 1); challengeImage.GetComponent <RawImage>().texture = challenge.Image.GetComponent <RawImage>().texture; challengeTitle.GetComponent <Text>().text = challenge.Title; challengeDescription.GetComponent <Text>().text = challenge.Description; challengePanel.SetActive(true); yield return(new WaitForSeconds(7)); challengePanel.SetActive(false); challengeTitle.GetComponent <Text>().text = ""; challengeDescription.GetComponent <Text>().text = ""; }