コード例 #1
0
    private void OnTriggerEnter(Collider other)
    {
        GetComponent <AudioSource>().PlayOneShot(baseHitSFX);

        health -= healthDecrement;
        baseScore.SetHealth(health);

        if (health <= 0)
        {
            SelfDestruct();
        }
    }
コード例 #2
0
 private void Start()
 {
     baseScore = FindObjectOfType <BaseScore>();
     baseScore.SetHealth(health);
 }