// Start is called before the first frame updat private void OnTriggerEnter2D(Collider2D hitInfo) { CircleEnemy Circleenemy = hitInfo.GetComponent <CircleEnemy> (); if (Circleenemy != null) { ScoreCalc(-200); Circleenemy.TakeCircleDamage(1000); } SquareEnemy Squareenemy = hitInfo.GetComponent <SquareEnemy> (); if (Squareenemy != null) { ScoreCalc(-200); Squareenemy.TakeSquareDamage(1000); } TriEnemy Trienemy = hitInfo.GetComponent <TriEnemy> (); if (Trienemy != null) { ScoreCalc(-200); Trienemy.TakeTriDamage(1000); } HexEnemy Hexenemy = hitInfo.GetComponent <HexEnemy> (); if (Hexenemy != null) { ScoreCalc(-200); Hexenemy.TakeHexDamage(1000); } }
private void OnTriggerEnter2D(Collider2D hitInfo) { explosionSound.Play(); CircleEnemy Circleenemy = hitInfo.GetComponent <CircleEnemy> (); if (Circleenemy != null) { if (circle == true) { ScoreCalc(25); Circleenemy.TakeCircleDamage(damage); BulletEffect(); } else { BulletEffect(); } } SquareEnemy Squareenemy = hitInfo.GetComponent <SquareEnemy> (); if (Squareenemy != null) { if (square == true) { ScoreCalc(25); Squareenemy.TakeSquareDamage(damage); BulletEffect(); } else { BulletEffect(); } } TriEnemy Trienemy = hitInfo.GetComponent <TriEnemy> (); if (Trienemy != null) { if (triangle == true) { ScoreCalc(25); Trienemy.TakeTriDamage(damage); BulletEffect(); } else { BulletEffect(); } } HexEnemy Hexenemy = hitInfo.GetComponent <HexEnemy> (); if (Hexenemy != null) { if (hexagon == true) { ScoreCalc(50); Hexenemy.TakeHexDamage(damage); BulletEffect(); } else { BulletEffect(); } } }