// 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); } }
private void Awake() { timer = FindObjectOfType(typeof(GameTimer)) as GameTimer; grid = FindObjectOfType(typeof(PlotGrid)) as PlotGrid; }