예제 #1
0
    void Spawn()
    {
        flightOrder = enemiesController.FlightOrder();

        if (flightOrder)
        {
            heading = waypoints.GetWaypoint(headingIndex).transform;
        }
        else
        {
            heading = waypoints.GetRNGWaypoint().transform;
        }
        NewDirection();
    }
예제 #2
0
    void Start()
    {
        // grab components
        //enemiesController = GameObject.Find("Enemies").GetComponent<EnemiesController>();
        enemiesController = transform.parent.GetComponent <EnemiesController>();
        waypoints         = enemiesController.GetWaypoinmts();
        //waypoints = GameObject.Find("Waypoints").GetComponent<Waypoints>();
        RB     = GetComponent <Rigidbody2D>();
        eSpeed = enemiesController.GetEnemySpeed();

        headingIndex      = 0;
        waypointThreshold = 5f;

        flightOrder = enemiesController.FlightOrder();

        if (flightOrder)
        {
            heading = waypoints.GetWaypoint(headingIndex).transform;
        }
        else
        {
            heading = waypoints.GetRNGWaypoint().transform;
        }
        NewDirection();
        //Spawn();
    }