public void RandomizeValue(int max = -1) { buttonsShowing = GameObject.Find("ControlPanel").GetComponent <ButtonsOnScreen>(); //Debug.Log("Buttons = "+ buttonsShowing.buttonsAnimated); if (max < 0) { max = (int)Mathf.Pow(2, buttonsShowing.buttonsAnimated); // Debug.Log("Max = " + max); } SetValue(Random.Range(0, max)); }
void Start() { GameObject controlPanel = GameObject.Find("ControlPanel"); buttonsShowing = controlPanel.GetComponent <ButtonsOnScreen>(); }