i'm making game on panel , want write "game over" text on panel want write in way when see writing on real time. have this. new unity please me
thanks
if want draw appears though person literally writing out (i.e. see individual pencil strokes lines of each letter), out of luck. sort of thing cannot done unity's animation tools.
if, however, want 1 letter appear @ time, following:
public ienumerator writetext(string words) { text textbox = gameobject.getcomponent<text>(); stringbuilder sb = new stringbuilder(); foreach(char c in words) { sb.append(c); textbox.text = sb.tostring(); yield return new waitforseconds(0.25f); } } you attach script containing text object , call writetext("game over"); when needed game over. adjust number in waitforseconds constructor speed or slow down.
(note: there few small errors names, etc. in code; i'm not on machine unity right now. should pretty trivial fix though.)
Comments
Post a Comment