public void Die()
 {
     bodyAnimator.SetBool("IsMoving", false);
     marineBody.transform.parent = null;
     marineBody.isKinematic      = false;
     marineBody.useGravity       = true;
     marineBody.gameObject.GetComponent <CapsuleCollider>().enabled = true;
     marineBody.gameObject.GetComponent <Gun>().enabled             = false;
     Destroy(head.gameObject.GetComponent <HingeJoint>());
     head.transform.parent = null;
     head.useGravity       = true;
     SoundManager.Instance.PlayOneShot(SoundManager.Instance.marineDeath);
     deathParticles.Activate();
     Destroy(gameObject);
 }
Beispiel #2
0
 public void Die()
 {
     isAlive = false;
     head.GetComponent <Animator>().enabled = false;
     head.isKinematic = false;
     head.useGravity  = true;
     head.GetComponent <SphereCollider>().enabled = true;
     head.gameObject.transform.parent             = null;
     head.velocity = new Vector3(0, 26.0f, 3.0f);
     OnDestroy.Invoke();
     OnDestroy.RemoveAllListeners();
     SoundManager.Instance.PlayOneShot(SoundManager.Instance.alienDeath);
     head.GetComponent <SelfDestruct>().Initiate();
     if (deathParticles)
     {
         deathParticles.transform.parent = null;
         deathParticles.Activate();
     }
     Destroy(gameObject);
 }