private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Player" && AudioOnce == false && canDoDamage == true)
     {
         AudioOnce = true;
         self_rigidbody.useGravity   = true;
         self_rigidbody.isKinematic  = false;
         gameObject.transform.parent = null;
         orb_materials[0]            = BlackMaterialOrb;
         orb_materials[1]            = BlackMaterialOrb;
         orbRend.materials           = orb_materials;
         PlayerHealthSlider.value   -= .5f;
         CharMoveOrbReference.HitBarColor();
         HitAudio.Play();
         gameObject.GetComponent <ParticleSystem>().Emit(1);
     }
 }
Пример #2
0
 private void DoDamage()
 {
     PHealthSlider.value -= .01f;
     CharMoveReferencee_.HitBarColor();
 }