Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (collision.CompareTag("EnemyA") || collision.CompareTag("EnemyLaser"))
- {
- if (_isShieldActive == false)
- {
- Damage();
- }
- if (_isShieldActive == true)
- {
- _countTimesHit.Add(_intToAdd++);
- if (_isShieldActive == true && _countTimesHit.Count == 1)
- {
- _shieldSpriteRenderer.color = Color.red;
- }
- else if (_isShieldActive == true && _countTimesHit.Count == 2)
- {
- _shieldSpriteRenderer.color = Color.black;
- }
- else
- {
- _shieldSpriteRenderer.color = Color.white;
- _isShieldActive = false;
- _shieldPrefab.SetActive(false);
- _countTimesHit.Clear();
- _audioSource.Stop(); _audioSource.loop = false;
- _audioSource.clip = _shieldOnPlayerActive;
- _audioSource.PlayOneShot(_shieldIsOver, 3);
- // return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement