Also these are Curvy Spline and trigger scripts:
Code:
using UnityEngine;
using System.Collections;
using PathologicalGames;
using FluffyUnderware.Curvy.Controllers;
public class TriggerScript : MonoBehaviour {
public Transform enemy;
public FluffyUnderware.Curvy.CurvySpline curvySpline;
private SplineController sc;
private int count = 0;
void OnTriggerEnter(Collider other)
{
Debug.Log("Triggered.");
Enemy1Create();
}
void Enemy1Create()
{
sc = enemy.GetComponent<SplineController>();
PoolManager.Pools["EnemyPool"].Spawn(enemy);
sc.Spline = curvySpline;
//Instantiate(enemy, Vector3.zero, Quaternion.identity);
sc.Play();
count++;
if (count < 3)
Invoke("Enemy1Create", 0.7f);
}
}