Friday, 15 June 2012

c# - Display the score in unity -


I am totally new to unity, I am using a simple 2D platformer game unity. Does anyone help me display scores on the game? I'm stored the value on a variable variable below to the C # code which I used for the distance.

  using UnityEngine; Using System.Collections; Distance of public squared: Monobehavier {Private Ent Dish; // It is initialization zero awake () {dist = 0; } // update is called zero update per frame () {dist = dist + = 1 * Time.deltaTime; Print ("district:" + distribution); }}  

I have to display the dist value on the screen. I have put a GUI text on the screen.

To make it simple, you can - where are you printing something like this:

  GameAbject.Fund ("GUIText"). GuiText.text = dist;  

, assuming that your GITED object is called GUIText . In fact, with that, you will find the object named, enter your text element, and modify it with the dist value.


No comments:

Post a Comment