I want to make just a display part but i didnt fix it these errors.
Assets/HSController.cs(20,23): error CS1061: Type UnityEngine.GameObject' does not contain a definition for
text’ and no extension method text' of type
UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)
Assets/HSController.cs(30,31): error CS1061: Type UnityEngine.GameObject' does not contain a definition for
text’ and no extension method text' of type
UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)
using UnityEngine;
using System.Collections;
public class HSController : MonoBehaviour
{
public string highscoreURL = “http://localhost/display.php”;
public GameObject text1;
public GameObject text2;
void Start()
{
StartCoroutine(GetScores());
}
// Get the scores from the MySQL DB to display in a GUIText.
// remember to use StartCoroutine when calling this function!
IEnumerator GetScores()
{
text1.text = "Loading Scores";
WWW hs_get = new WWW(highscoreURL);
yield return hs_get;
if (hs_get.error != null)
{
print("There was an error getting the high score: " + hs_get.error);
}
else
{
text2.text = hs_get.text; // this is a GUIText that will display the scores in game.
}
}
}