// 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>();
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     shotCounter = Random.Range(minTimeBetweenShots, maxTimeBetweenShots);
     health      = StartHealth;
     //Debug.Log("enemy laser from Start:"+xProjectile);
     aKeepScore = FindObjectOfType <keepScor>();
     agent      = FindObjectOfType <LaserAgent>();
     Player     = GameObject.Find("Player");
     if (agent != null)
     {
         thisEnemyIndex = agent.getFirstAvailableEnemyIndex(1);
         if (thisEnemyIndex >= 0)
         {
             agent.setEnemyActive(1, thisEnemyIndex, true); /* turn enemy to active*/
         }
         else
         {
             Destroy(gameObject);
         }
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     SetUpMoveBoundaries();
     // Debug.Log("player laser" + aLaser);
     health     = StartHealth;
     agent      = FindObjectOfType <LaserAgent>();
     aKeepScore = FindObjectOfType <keepScor>();
 }
 // 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>();
 }
Esempio n. 5
0
 // Update is called once per frame
 void Update()
 {
     //Move();
     //  Fire();
     if (agent == null)
     {
         agent = FindObjectOfType <LaserAgent>();
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (player == null)
     {
         player = GameObject.Find("Player");
     }
     if (agent == null)
     {
         agent = FindObjectOfType <LaserAgent>();
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (thisEnemyIndex == -1)
     {
         thisEnemyIndex = GetComponent <enemy>().thisEnemyIndex;
     }
     if (agent == null)
     {
         agent = FindObjectOfType <LaserAgent>();
     }
     Move();
 }
    // Use this for initialization
    void Start()
    {
        agent  = FindObjectOfType <LaserAgent>();
        Player = GameObject.Find("Player");

        if (agent != null)
        {
            thisEnemyLaserIndex = agent.getFirstAvailableEnemyIndex(EnemyOrPlayer); //use 3 for enemy laser index 2 for player.
            if (thisEnemyLaserIndex >= 0)
            {
                agent.setEnemyActive(EnemyOrPlayer, thisEnemyLaserIndex, true); /* turn enemy to active*/
            }
            else
            {
                Destroy(gameObject);
            }
        }
        else
        {
            Destroy(gameObject);
        }
    }
 void Start()
 {
     // Debug.Log(gameScore);
     player = GameObject.Find("Player");
     agent  = FindObjectOfType <LaserAgent>();
 }
Esempio n. 10
0
 void Start()
 {
     agent = FindObjectOfType <LaserAgent>();
 }
Esempio n. 11
0
 void Start()
 {
     agent            = GetComponent <LaserAgent>();
     animator         = GetComponent <Animator>();
     animator.enabled = settings.blinkAnim;
 }