// Use this for initialization void Start() { HealHP.SetActive(false); sound = this.gameObject.GetComponent <AudioSource> (); //3DTextの初期化 textMesh = transform.FindChild("PlayerLevel").GetComponent <TextMesh> (); textMesh.text = HP + ""; }
void OnTriggerEnter(Collider col) { if (col.tag == "HPBall") { HP += 10; textMesh.text = HP + ""; HealHP.SetActive(false); HealHP.SetActive(true); col.gameObject.SetActive(false); sound.Play(); } }