// Use this for initialization void Awake() { StatText = Stats.GetComponent <TextMeshProUGUI>(); AttributeManager = GetComponentInParent <Attribute_Manager>(); PlusStats = transform.parent.gameObject.GetComponentInChildren <Plus_Stats>(); // StatModifier = 0; }
// Use this for initialization void Start() { int offset = 0; // for offsetting the array Attribute_Manager = GetComponentInParent <Attribute_Manager>(); foreach (Transform child in transform) {//Get the number of children // its 6 but incase there is morein the future if (child.CompareTag("EditableUI")) { childCount++; } else { offset++; } } Displayed_Attributes = new GameObject[childCount]; int arrayOffset = 0; for (int i = 0; i < childCount + offset; ++i) { // Filling in the data into the array of displayed attributes if (transform.GetChild(i).CompareTag("EditableUI")) { // minus from offset Displayed_Attributes[i - arrayOffset] = transform.GetChild(i).gameObject; } else { // If the child isnt a Attribute UI that is editable arrayOffset++; } } }
//private Image // Use this for initialization void Awake() { StatText = Stats.GetComponent <TextMeshProUGUI>(); AttributeManager = GetComponentInParent <Attribute_Manager>(); //AttributeManager.Modifier[(int)Stat] = 0; }
// Use this for initialization void Awake() { StatText = GetComponent <TextMeshProUGUI>(); AttributeManager = GetComponentInParent <Attribute_Manager>(); }