Esempio n. 1
0
 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;
 }
Esempio n. 2
0
    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;
        }
    }
Esempio n. 3
0
    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;
        }
    }
Esempio n. 4
0
 // Start is called before the first frame update
 void Start()
 {
     scores = GameObject.Find("score1").GetComponent <scoreTracker1>();
     initialStory();
 }