Schmup-JIN/Assets/Scripts/EnemyCharacter.cs

31 lines
612 B
C#
Raw Normal View History

using System;
using System.Collections;
2019-09-17 15:43:40 +02:00
using System.Collections.Generic;
using UnityEngine;
public class EnemyCharacter : AbstractCharacter
2019-09-17 15:43:40 +02:00
{
public override void Move(Vector2 movementDirection)
2019-09-17 15:43:40 +02:00
{
_mover.Direction = movementDirection;
2019-09-17 15:43:40 +02:00
}
public override void Shoot()
2019-09-17 15:43:40 +02:00
{
// Always shoot
_shooter.Shoot(_shooter.EnergyCost+1);
}
// TODO : Gain points, maybe through Events?
protected override void Death()
{
Destroy(gameObject);
}
// Don't gain points
private void OnBecameInvisible()
{
Destroy(gameObject);
2019-09-17 15:43:40 +02:00
}
}