Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Mechanical Counter (Odometer) GUI script

Discussion in 'Assets and Asset Store' started by hencz, May 10, 2011.

  1. hencz


    Aug 19, 2010
    Hi everyone
    I'd like to introduce my counter script:

    Low draw call mechanical counter (odometer) GUI script. (One Material per Font)
    Can be used to display scores or lives on the HUD.


    -Make a Bitmap Font, with a Bitmap Font Generator of your desired font.

    -Create an Empty GameObject and attach Counter.cs script to it.

    -A MeshFilter and a MeshRenderer will be added to the GameObject, set the material.

    -Right-Click the attached Counter script and select Build Character Map from the context menu.

    -Put your generated font to the Font Texture slot, and the Font Definition file (.fnt - rename it to .txt for unity) to the Font Definition slot.

    -Hit Build.

    -Use the Counter.Value non-static property in your script to set the desired value.

    Preview Demo

    Tibor Hencz
    Last edited: May 10, 2011