// Update is called once per frame void Update() { enemySpeed = uiapi.GetEnemySpeed(); numberOfEnemiesInScene = enemies.Count; if (numberOfEnemiesInScene < maxNumberOfEnemies) { SpawnEnemy(); } // change flight navigation order if (Input.GetKeyDown(KeyCode.J)) { if (flightOrder) { flightOrder = false; uiapi.SetWaypoint("Random"); } else { flightOrder = true; uiapi.SetWaypoint("Sequenced"); } } }