// Use this for initialization void Start() { playerProgression = GameObject.FindGameObjectWithTag("Controller").GetComponent <PlayerProgression> (); //vraag voor data uit save stuff e als parameter geef mee zijn level index om goede dta te krijgen if (levelIndex <= playerProgression.currentLevel) { unlockState = true; if (levelIndex == playerProgression.currentLevel) { originalArtName = "Current"; } else { originalArtName = "Open"; } levelImage = Resources.Load <Sprite> ("Menu/LevelPictureArt/Level" + levelIndex.ToString()); } else { originalArtName = "Locked"; levelImage = Resources.Load <Sprite> ("Menu/LevelPictureArt/Locked"); } if (GetComponent <Image> ().sprite.name != "Selected") { ChangeArtTo(originalArtName); } timeCompleteInfo = playerProgression.GetLevelTime(levelIndex); }
void Start() { playerProgression = GameObject.Find("GameController").GetComponent <PlayerProgression> (); score = GameObject.Find("YourTime").GetComponent <Text>(); bestTime = GameObject.Find("BestTime").GetComponent <Text>(); worldTime = GameObject.Find("WorldBestTime").GetComponent <Text>(); score.text = TimeConverter.SecTimeToHumanTimeString(GameObject.Find("TimeText").GetComponent <UITimer> ().TotalTime()); bestTime.text = TimeConverter.SecTimeToHumanTimeString(playerProgression.GetLevelTime(playerProgression.currentPlayingLevel)); if (bestTime.text == "") { bestTime.text = "First time played"; } string url = "http://15826.hosts.ma-cloud.nl/Leerjaar2/Projecten/Mythe/phpRecordTimeGet.php"; WWWForm form = new WWWForm(); form.AddField("level", playerProgression.currentPlayingLevel); WWW www = new WWW(url, form); StartCoroutine(WaitForRequest(www)); }