// Use this for initialization
    void Start()
    {
        buttonArray = GameObject.FindObjectsOfType<DefenderButton> ();

        costText = GetComponentInChildren<Text>();
        if (!costText) {Debug.LogWarning (name + " has no cost text");}

        costText.text = defenderPrefab.GetComponent<Defender> ().starCost.ToString ();
    }
Example #2
0
	void Start () {
		buttons = GameObject.FindObjectsOfType<DefenderButton>();
		costText = GetComponentInChildren<Text>();
		costText.text = defenderPrefab.GetComponent<Defenders>().starCost.ToString();
	}