Hi,
I have got the problem that I want to change a text GUI element through script in unity 4.6 for showing a score in my game but I do not get it to work because I dont know how to access the Text component. So if anyone could help me I would be rally happy
// UnityScript
import UnityEngine.UI;
var someText: Text;
function Start()
{
someText = GetComponent.<Text>(); //
}
function Update()
{
someText.text = "Hello and junk";
}
// c#
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class SomeScriptName : MonoBehaviour
{
public Text someText;
void Start()
{
someText = GetComponent<Text>();
}
void Update()
{
someText.text = "Hello im some text";
}
}