// Use this for initialization void Start() { dpm = GameObject.Find("GameManager").GetComponent <DicePointManager>(); dpm.GetDP(); this.dpText = this.GetComponent <Text>(); this.dpText.text = dpm.GetDP().ToString(); }
// Update is called once per frame void Update() { if (!button.interactable) { if (dpm.GetDP() >= cost) { button.interactable = true; } } else { if (dpm.GetDP() < cost) { button.interactable = false; } } }
// Update is called once per frame void Update() { this.dpText.text = dpm.GetDP().ToString(); }