// Use this for initialization void Awake() { _startController = GameObject.Find("WarpTunnel").GetComponent <WarpTunnel>(); bullets = new List <GameObject>(); if (!isTieFighter) { for (int i = 0; i < poolAmount; i++) { GameObject newBullet; if (i % 2 == 1) { newBullet = Instantiate(bg_laser_obj[0]); } else { if (!isTurret) { newBullet = Instantiate(bg_laser_obj[1]); } else { newBullet = Instantiate(bg_laser_obj[0]); } } newBullet.SetActive(false); bullets.Add(newBullet); } } if (!isBGSpawner) { target = GameObject.Find("X-Fighter"); } rng_fire_rate = Random.Range(spawnRate.x, spawnRate.y); }
void Start() { _startController = GameObject.Find("WarpTunnel").GetComponent <WarpTunnel>(); randomizedZOffset = Random.RandomRange(offsetZRange.x, offsetZRange.y); offset = new Vector3(offset.x, offset.y, randomizedZOffset); target = GameObject.Find("X-Fighter"); spawnRNGTime = Random.Range(.5f, spawnRNGTimeRange); //startPos = transform.position; }
// Use this for initialization void Awake() { _startController = GameObject.Find("WarpTunnel").GetComponent <WarpTunnel>(); target = GameObject.Find("X-Fighter"); spawnRNGTime = Random.Range(.5f, spawnRNGTimeRange); }