- Home /
The question is answered, right answer was accepted
Render Debug.Log as UI Text
OK Seeing how I'm getting absolutely nowhere with my other question even though it's part ways there how do I go about rendering Debug.Log information as a UI text NOT OnGUI but UI Text?
void PlayCurrent()
{
source.clip = clips[currentIndex];
source.Play();
Debug.Log (source.clip);
}
Answer by Mmmpies · Mar 09, 2015 at 07:34 PM
Well I just added a test public Text onto my canvas, added an AudioClip "clip" as public and add an OnClick event trigger to call TestUI and output the Text to output the following:
public Text MyText;
public AudioClip clip;
public void TestUI()
{
MyText.text = clip.ToString();
}
Outputs whatever audioclip I drag onto the public slot for the script.
Thanks $$anonymous$$mmpies, although I did not get a chance to try out your option I'm going to save it as it looks to be something very useful I could use in my project somewhere for sure. Vintar had what I was looking for but I gave your answer a big thumbs up :)