// Use this for initialization
    void Start()
    {
        Vector3 aVector;
        Vector3 bVector;

        player         = GameObject.Find("Player");
        Xwaypoints     = (waveConfig.GetWaypoints());
        waypoints      = new Vector3[2];
        waypoints[0].x = Xwaypoints[0].transform.position.x;
        waypoints[0].y = Xwaypoints[0].transform.position.y;
        waypoints[1].x = Xwaypoints[1].transform.position.x;
        waypoints[1].y = Xwaypoints[1].transform.position.y;
        //  Debug.Log(waypoints[0])

        // aVector.x = Random.Range(-8.5f, 8.5f);
        aVector.x      = player.transform.position.x + Random.Range(-0.1f, 0.1f);
        waypoints[0].x = aVector.x;
        waypoints[1].x = aVector.x;

        //  waypoints[1].transform.position = bVector;
        transform.position = waypoints[0];
        moveSpeed          = waveConfig.GetmoveSpeed();
        thisEnemyIndex     = GetComponent <enemy>().thisEnemyIndex;
        agent = FindObjectOfType <LaserAgent>();
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     waypoints          = waveConfig.GetWaypoints();
     transform.position = waypoints[0].transform.position;
     moveSpeed          = waveConfig.GetmoveSpeed();
     thisEnemyIndex     = GetComponent <enemy>().thisEnemyIndex;
     agent = FindObjectOfType <LaserAgent>();
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     waypoints          = waveConfig.GetWaypoints();
     transform.position = waypoints[0].transform.position;
     moveSpeed          = waveConfig.GetmoveSpeed();
 }