Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (Player == null)
        {
            Player = GameObject.FindGameObjectWithTag("Player");
        }

        m_SpawnPickup = this.gameObject.GetComponent <SpawnPickup>();

        rb = this.gameObject.GetComponent <Rigidbody2D>();

        Enemy = this.gameObject;
    }
Example #2
0
    //private float Deathtimer = 100f;

    // Start is called before the first frame update
    void Start()
    {
        if (Player == null)
        {
            Player = GameObject.FindGameObjectWithTag("Player");
        }
        if (Bullet == null)
        {
            Bullet = (GameObject)Resources.Load("Prefabs/Bullet") as GameObject;
        }

        fireProj = this.gameObject.GetComponent <FireProjectile>();
        fireProj.SetProjectile(Bullet);

        m_SpawnPickup = this.gameObject.GetComponent <SpawnPickup>();

        Enemy = this.gameObject;
    }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        SpriteRender = GetComponent <SpriteRenderer>();
        if (SpriteRender.sprite == null)
        {
            SpriteRender.sprite = Head;
        }

        if (Player == null)
        {
            Player = GameObject.FindGameObjectWithTag("Player");
        }

        m_SpawnPickup = this.gameObject.GetComponent <SpawnPickup>();

        rb = this.gameObject.GetComponent <Rigidbody2D>();

        Enemy = this.gameObject;
    }
Example #4
0
    IEnumerator SpawnWave()
    {
        wave++;

        foreach (Transform t in pickupSpawners)
        {
            SpawnPickup spawner = (SpawnPickup)t.GetComponent <SpawnPickup>();
            spawner.SpawnAPickup();
        }

        for (int i = 0; i < wave; i++)
        {
            foreach (Transform t in spawnPoints)
            {
                SpawnRandom(t);
                numEnemiesThisWave++;
            }

            yield return(new WaitForSeconds(5.0f));
        }
    }