private void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "MainShipBullet") { m_SpaceshipBehaviour.ReceiveDamage(collider.gameObject.GetComponent <BulletBehaviour>().m_Damage); } if (collider.gameObject.tag == "MainShipMissile") { m_SpaceshipBehaviour.ReceiveDamage(collider.gameObject.GetComponent <MissileBehaviour>().m_Damage); } if (collider.gameObject.tag == "MainShipExplosion") { m_SpaceshipBehaviour.ReceiveDamage(m_AmountDamageSplashExplosion); } }
private void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "EnemyBullet") { m_MainSpaceshipBehaviour.ReceiveDamage(collider.gameObject.GetComponent <BulletBehaviour>().m_Damage); } if (collider.gameObject.tag == "EnemyMissile") { m_MainSpaceshipBehaviour.ReceiveDamage(collider.gameObject.GetComponent <MissileBehaviour>().m_Damage); } if (collider.gameObject.tag == "Enemy" || collider.gameObject.tag == "Asteroid") { m_MainSpaceshipBehaviour.ReceiveDamage(1); } }