protected void PlayDeathAnimation() { Animator animator = gameObject.GetComponent <Animator>(); if (animator != null) { animator.SetTrigger("Death"); Destroy(gameObject, 0.5f); } ParticleSystem particleSystem = gameObject.GetComponent <ParticleSystem>(); if (particleSystem != null) { particleSystem.Play(); } StoneSelfDestruct selfDestructScript = gameObject.GetComponent <StoneSelfDestruct>(); if (selfDestructScript != null) { selfDestructScript.SelfDestruct(); Destroy(gameObject, 1.0f); } }
protected void PlayDeathAnimation() { Animator animator = gameObject.GetComponent <Animator>(); if (animator != null) { animator.SetTrigger("Death"); Destroy(gameObject, 0.5f); return; } StoneSelfDestruct selfDestructScript = gameObject.GetComponent <StoneSelfDestruct>(); if (selfDestructScript != null) { selfDestructScript.SelfDestruct(); Destroy(gameObject, 1.0f); } }