Beispiel #1
0
 void Start()
 {
     //assigns the variables to their associated components of gameObjects.
     BackToDeck   = GameObject.Find("BackToDeckBuild").GetComponent <Button> ();
     gamehandling = GameObject.Find("GameHandler").GetComponent <GameHandling> ();
     //allows execution of tasks upon tapping of the button.
     BackToDeck.onClick.AddListener(TaskOnClick);
 }
 void Start()
 {
     //finds the object with GameHandling.cs attached
     gamehandling = GameObject.Find("GameHandler").GetComponent <GameHandling> ();
     //finds the button
     UseAllCards = GameObject.Find("UseAllCards").GetComponent <Button> ();
     //allows tasks to execute from the TaskOnClick void upon tapping the button.
     UseAllCards.onClick.AddListener(TaskOnClick);
     //fills the array with all the sprites in the Resources folder.
     cardsToUse = Resources.LoadAll <Sprite> ("");
 }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        GameHandling gs = (GameHandling)target;

        GUILayout.Space(20);
        if (GUILayout.Button("Restart Game", buttonOption))
        {
            gs.RestartGame();
        }

        GUILayout.Space(20);
        if (GUILayout.Button("Spwan Patch", buttonOption))
        {
            gs.spawnAPatch();
        }
    }
Beispiel #4
0
 void Start()
 {
     NextRoundButton = GameObject.Find("NextRound").GetComponent <Button>();
     gamehandling    = GameObject.Find("GameHandler").GetComponent <GameHandling> ();
     NextRoundButton.onClick.AddListener(TaskOnClick);
 }