// The speed to use when in “ramming” mode
[SerializeField] float RamSpeed = 5.0f;
// The different IDs fo the AI states
enum AIMode {Normal, Ramming, SteerTowards, Charge, Avoid };
// The variable which holds the current AI state
private AIMode CurrentAIState;
// List of pickup TYPES to spawn
[SerializeField]GameObject[] PickupTypes;
// Holds the audio clip to play
// when this object is spawned
[SerializeField]AudioClip EnemyDestSfxClip;
// The particle system to spawn when the
// projectile collides with something.
[SerializeField]GameObject EnemyParticles;
// The game object which spawned us.
private ShipPlayerController PlayerShipCtrl;
// Used to control how fast the game object moves
[SerializeField] float MoveSpeed = 3.0f;
// Instantiates a particle when something is hit.
// Represents the "death of THIS game object, not
// the desruction of what the projectile hit.
void SpawnEnemyParticles()
{
Instantiate (EnemyParticles,
transform.position, transform.rotation);
}
// A customized version of the destroy function
void StartDestroy(float timeDelay)
{
// Turn off drawing and colliding
renderer.enabled = false;
collider.enabled = false;
// Start the destroy countdown
Destroy (gameObject, timeDelay);
}