// Update is called once per frame void Update() { //それぞれ設定されたタイプに応じて取得数を取得し、表示 switch (itemType) { case ItemType.Attack: this.GetComponent <Text>().text = playerAbility.GetAttackItemCount().ToString(); break; case ItemType.KnockBack: this.GetComponent <Text>().text = playerAbility.GetKnockBackItemCount().ToString(); break; case ItemType.Respawn: this.GetComponent <Text>().text = playerAbility.GetRespawnItemCount().ToString(); break; case ItemType.Wire: this.GetComponent <Text>().text = playerAbility.GetWireItemCount().ToString(); break; } }