public void AddAttribute(AttributeUI attribute) { if (attribute == null) { return; } attribute.AddAttribute(); availableAttributePoints--; UpdateAvailablePoints(); }
private AttributeUI spawnPrefab(AttributeUI UIElement){ GameObject go = NGUITools.AddChild(gameObject, UIElement.gameObject); AttributeUI aUI = go.GetComponent<AttributeUI>(); /*GameObject go = (GameObject)GameObject.Instantiate (UIElement.gameObject); AttributeUI aUI = go.GetComponent<AttributeUI>(); go.transform.parent = this.transform; go.transform.localScale = Vector3.one;*/ return aUI; }