void Awake() { StatText = gameObject.GetComponent <Text>(); characterScript = GameObject.Find("Game Info Component").GetComponent <CharacterCreationScript>(); characterScript.RegisterToNotifyStatChange(UpdatedStat); UpdatedStat(); }
// Use this for initialization void Start() { AttributeValueText = transform.Find("Value").GetComponent <Text>(); creationScript = GameObject.Find("Game Info Component").GetComponent <CharacterCreationScript>(); if (creationScript != null) { creationScript.RegisterToNotifyStatChange(UpdateDisplayedValue); } UpdateDisplayedValue(); }