/// <summary> /// has all button parents update their children to check if the player has enough money /// </summary> private void UpdateExchangeParents() { GameObject[] parents = GameObject.FindGameObjectsWithTag("ExchangeButtonParent"); foreach (GameObject p in parents) { ExchangeButtonParent e = p.GetComponent <ExchangeButtonParent>(); if (e != null) { e.UpdateButtons(); } } }
private void Start() { parent = GetComponentInParent <ExchangeButtonParent>(); UpdateImage(); }