-
Book Overview & Buying
-
Table Of Contents
Unity Android Game Development by Example Beginner's Guide
By :
We now need to create a script that will control the indicator slices. This will include creating new slices as they are needed. Also, the GameObject it is attached to will act as a center point for the indicator slices, that we just created, to rotate around.
Create a new script and name it IndicatorControl.
We start this script off with a pair of variables. The first will hold a reference to the prefab that was just created. This will allow us to spawn instances of it whenever we desire. The second is a static variable, meaning it can be easily accessed without a reference to the component that exists in the scene. It will be filled when the game starts with a reference to the instance of this script that is in the scene.
public GameObject indicatorPrefab; private static IndicatorControl control;
This next function will be used by the targets. Soon, we will be updating the target's script to call this function at the beginning of the game. The function...
Change the font size
Change margin width
Change background colour