SpermicidalWave.cs 816 B

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. using System.Collections;
  3. public class SpermicidalWave : CondomBase
  4. {
  5. protected override void CustomFixedUpdate()
  6. {
  7. transform.localPosition += new Vector3(-speed * Time.deltaTime, 0);
  8. if (transform.localPosition.x < -GameConstants.GAME_WIDTH * 3/2)
  9. {
  10. _poolObject.Despawn();
  11. NotificationCenter.Post(NotificationType.SpermicidalWaveDespawned);
  12. }
  13. }
  14. public override void CapturedEnemy(Enemy enemy)
  15. {
  16. NotificationCenter.Post(NotificationType.SpermHitBySpermicidalWave, enemy);
  17. ProjectileParticleSystem.Instance.Explode(enemy.transform.TransformPoint(enemy.hitOffset));
  18. enemy.GotHit();
  19. enemy.Despawn();
  20. SoundManager.Play(SoundEvent.torpedodestroy);
  21. }
  22. public override bool CanCaptureEnemy(Enemy enemy)
  23. {
  24. return true; //Can capture everything (including viruses)
  25. }
  26. }