Example #1
0
    // initialize plot values
    public void Initialize(PlotGrid grid, int xVal, int zVal, int index = -1)
    {
        this.grid   = grid;
        this.xValue = xVal;
        this.zValue = zVal;

        if (skins.Length > 0)
        {
            if (index >= 0)
            {
                skinIndex = index;
            }
            else
            {
                // randomize skin index
                skinIndex = Random.Range(0, skins.Length);
            }

            transform.GetChild(skinIndex).gameObject.SetActive(true);
        }
    }
Example #2
0
 private void Awake()
 {
     timer = FindObjectOfType(typeof(GameTimer)) as GameTimer;
     grid  = FindObjectOfType(typeof(PlotGrid)) as PlotGrid;
 }