public void DeclareThis <T>(string element, T UIobject) where T : UIObject { switch (element) { case "UIMoneyContainer": moneyContainerUI = UIobject as UIMoneyContainer; break; } }
private void Awake() { parent = GetComponentInParent <UIMoneyContainer>(); text = GetComponent <Text>(); image = GetComponent <Image>(); if (parent) { parent.DeclareThis(Label, this, transform.GetSiblingIndex()); } }