Beispiel #1
0
    //overload for above, use when this enemy is supposed to be following a SteerPath
    public GameObject genMonster(float x, float y, float z, int monsterCode, SteerPath p)
    {
        GameObject    e     = genMonster(x, y, z, monsterCode);
        EnemySteering steer = e.GetComponent <EnemySteering>();

        steer.enabled = true;
        steer.setPath(pathManager, p);
        e.GetComponent <EnemyMover>().enabled = false;

        return(e);
    }
Beispiel #2
0
    public IEnumerator SpawnPath(int numEnemy, int pathCode, int enemyCode, float spawnInterval)
    {
        for (int c = 0; c < numEnemy; c++)
        {
            SteerPath p     = pathManager.paths[pathCode];
            Vector3   point = p.getNodesAsVectorArray()[0];
            genMonster(point.x, point.y, point.z, enemyCode, p);

            yield return(new WaitForSeconds(spawnInterval));
        }
    }
Beispiel #3
0
 public void setPath(PathManager pm, SteerPath p)
 {
     pathManager = pm;
     path        = p;
     if (path.curve)
     {
         movementType = Mode.curveFollow;
     }
     else
     {
         movementType = Mode.pathFollow;
     }
 }
Beispiel #4
0
 void Start()
 {
     if (pathManager != null && path == null)
     {
         path = pathManager.paths[0];
         if (path.curve)
         {
             movementType = Mode.curveFollow;
         }
         else
         {
             movementType = Mode.pathFollow;
         }
     }
 }