void Start() { //Finds the score script that is attached to the object "score1". scores = GameObject.Find("score1").GetComponent <scoreTracker1>(); storyCheck = GameObject.Find("story").GetComponent <Story>(); currentSpawnTime = spawnTimer; }
void Start() { scores = GameObject.Find("score1").GetComponent <scoreTracker1>(); spawn = GameObject.Find("Spawner (Right)").GetComponent <Spawner>(); spawnLoc = spawn.randSpawn; //Chooses a random movement pattern. MovementRandomizer(); shootTime = timeBTWShots; rb = GetComponent <Rigidbody2D>(); if (GameObject.FindWithTag("Player") != null) { playerShip = GameObject.FindWithTag("Player").transform; } }
void OnEnable() { //When the enemy becomes active, resets the enemy state. timer = 1f; death = false; scores = GameObject.Find("score1").GetComponent <scoreTracker1>(); spawn = GameObject.Find("Spawner (Right)").GetComponent <Spawner>(); spawnLoc = spawn.randSpawn; //Chooses a random movement pattern. MovementRandomizer(); shootTime = 0.5f; rb = GetComponent <Rigidbody2D>(); if (GameObject.FindWithTag("Player") != null) { playerShip = GameObject.FindWithTag("Player").transform; } }
// Start is called before the first frame update void Start() { scores = GameObject.Find("score1").GetComponent <scoreTracker1>(); initialStory(); }