コード例 #1
0
 // OnTriggerEnter is called once per frame
 private void OnTriggerEnter(Collider other)
 {
     if (other.name != "Player")
     {
         HealthLevel.SubValue(.1f);
     }
 }
コード例 #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Zombie")
        {
            Health.SubValue(.1f);
        }

        if (Health.GetValue() <= 0)
        {
            GetComponent <ParticleSystem>().enableEmission = true;
            gameObject.SetActive(false);
            RestartButton.transform.localScale = new Vector3(1, 1, 1);
        }
    }