public void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "PlayerBullet") { SpacesphipAnimator.SetTrigger("Destroyed"); Destroy(gameObject, 1f); } if (collider.tag == "PlayerRotator") { SpacesphipAnimator.SetTrigger("Destroyed"); Destroy(gameObject, 1f); } if (collider.tag == "PlayerArrow") { SpacesphipAnimator.SetTrigger("Destroyed"); Destroy(gameObject, 1f); } if (collider.tag == "PlayerBeamWeapon") { SpacesphipAnimator.SetTrigger("Destroyed"); Destroy(gameObject, 1f); } if (collider.tag == "PlayerLightning") { SpacesphipAnimator.SetTrigger("Destroyed"); Destroy(gameObject, 1f); } }
public void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "EnemyBullet") { SpacesphipAnimator.SetBool("isDestroyed", true); Destroy(gameObject, 1f); } if (collider.tag == "EnemyLaser") { if (shieldIsDown == true) { SpacesphipAnimator.SetBool("isDestroyed", true); Destroy(gameObject, 1f); } else if (shieldIsDown == false) { } } }