コード例 #1
0
    void Awake()
    {
        StatText        = gameObject.GetComponent <Text>();
        characterScript = GameObject.Find("Game Info Component").GetComponent <CharacterCreationScript>();

        characterScript.RegisterToNotifyStatChange(UpdatedStat);

        UpdatedStat();
    }
コード例 #2
0
    // 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();
    }