O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - rig up the textures

We know most of what we need to get started. There's just a little trick with rotating the textures that we have to learn. But, first, let's set up our clock with the variables we'll need to draw the textures to the screen.

  1. Add variables for the new pie clock textures at the top of the clockScript:
    var clockFGMaxWidth:float; // the starting width of the foreground bar
    var rightSide:Texture2D;
    var leftSide:Texture2D;
    var back:Texture2D;
    var blocker:Texture2D;
    var shiny:Texture2D;
    var finished:Texture2D;
    
  2. In the Hierarchy panel, select the Clock Game Object.
  3. Just as we did with the bar clock, drag-and-drop the pie clock textures from the Project panel into their respective slots in the clockScript component ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required