Example #1
0
    public void OpenMenuGUI()
    {
        List <GameObject> buttons     = new List <GameObject>();
        GUIButton         startButton = CreateButton("Start");

        buttons.Add(startButton.gameObject);
        startButton.Fix();
        startButton.transform.localScale    = new Vector3(.01f, .01f, .01f);
        startButton.transform.localPosition = new Vector3(0f, .5f, 0f);
        startButton.OnSingleClick           = new Action(() =>
        {
            StartCoroutine(BigBoss.Starter.StartGame());
            foreach (GameObject go in buttons)
            {
                Destroy(go);
            }
        });

        GUIButton startButton2 = CreateButton("Disco Start");

        buttons.Add(startButton2.gameObject);
        startButton2.Fix();
        startButton2.transform.localScale    = new Vector3(.01f, .01f, .01f);
        startButton2.transform.localPosition = new Vector3(0f, -.5f, 0f);
        startButton2.OnSingleClick           = new Action(() =>
        {
            DiscoLight.color  = Color.white;
            DiscoLight.cookie = cookie;
            StartCoroutine(BigBoss.Starter.StartGame());
            foreach (GameObject go in buttons)
            {
                Destroy(go);
            }
        });
    }
Example #2
0
 public void AddButton(GUIButton button)
 {
     Grid.AddButton(button);
     button.Fix();
 }