- Home /
Question by
zak666 · Oct 23, 2017 at 10:41 AM ·
scriptingbasicsconvertbasic programming
error CS0103: The name `Convert' does not exist in the current context?
Hey Gang trying to make a simple check and Dowload Updates function for my game, Running into an ""error: error CS0103: The name `Convert' does not exist in the current context"" trying to make an update checker to check my dropbox to see if their is a new version :)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UpdateGame : MonoBehaviour {
public Text Updateprompt;
public Text UpdateText;
public GameObject PleaseUpdate;
public bool NoUpdateNeed;
IEnumerator Start(){
WWW Update = new WWW ("");
string update = Update.text;
if (update == Convert.ToString (1.1)) {
PleaseUpdate.SetActive = false;
NoUpdateNeed = true;
} else {
PleaseUpdate.SetActive = true;
NoUpdateNeed = false;
}
}
public void UpdateGameButton(){
Application.OpenURL (""); //Download URL for new Version
}
}
Comment
The Convert class is in the System namespace. if (update == System.Convert.ToString (1.1)) { ...
Best Answer
Answer by Dragate · Oct 23, 2017 at 10:53 AM
Why not just "1.1"?
Secondly, you'll need to add a
yield return Update;
after
WWW Update = new WWW ("");
It will take some milliseconds to get a response to your request.
Your answer
