Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (collision.tag == "Bullet")
- {
- // Only allow the method to fire once (ScoreUpdateSpecial())
- _scoreOnce = true;
- // You killed a boss therefore your counter goes up
- UIController.bossSpaceshipCounter++;
- Debug.Log(UIController.bossSpaceshipCounter);
- // Update the score in the score script
- _uIController.ScoreUpdateSpecial();
- // Make a copy of the explosion prefab to indicate an enemy death
- Instantiate(_explosionPrefab, transform.position, Quaternion.identity);
- // Play explosion sound
- AudioSource.PlayClipAtPoint(_alienExplosion, Camera.main.transform.position, 1f);
- // Make a copy of the _textPrefab score to indicate an enemy score
- Instantiate(_textPrefab, transform.position + new Vector3(0.1f, 1.1f, 0), Quaternion.identity);
- // Destroy the left bullet
- Destroy(collision.gameObject);
- // Destroy the enemy
- Destroy(this.gameObject);
- }
- else if (collision.tag == "Bullet2")
- {
- if (_scoreOnce == true)
- {
- // Update the score in the score script to make it double
- _uIController.ScoreUpdateSpecialDouble();
- // Make a copy of the explosion prefab to indicate an enemy death
- Instantiate(_explosionPrefab, transform.position, Quaternion.identity);
- // Play explosion sound
- AudioSource.PlayClipAtPoint(_alienExplosion, Camera.main.transform.position, 1f);
- // Make a copy of the _textPrefab score to indicate an enemy score
- Instantiate(_textPrefab, transform.position + new Vector3(0.1f, -1.1f, 0), Quaternion.identity);
- // Destroy the right bullet
- Destroy(collision.gameObject);
- // Destroy the enemy
- Destroy(this.gameObject);
- }
- // This allows the method to fire once only
- if (_scoreOnce == false)
- {
- // Update the score in the score script
- _uIController.ScoreUpdateSpecial();
- // Make a copy of the explosion prefab to indicate an enemy death
- Instantiate(_explosionPrefab, transform.position, Quaternion.identity);
- // Play explosion sound
- AudioSource.PlayClipAtPoint(_alienExplosion, Camera.main.transform.position, 1f);
- // Make a copy of the _textPrefab score to indicate an enemy score
- Instantiate(_textPrefab, transform.position + new Vector3(0.1f, -1.1f, 0), Quaternion.identity);
- // Destroy the right bullet
- Destroy(collision.gameObject);
- // Destroy the enemy
- Destroy(this.gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement