Exemplo n.º 1
0
        public void spawnAt(Vector3 pos)
        {
            GameObject tmp           = Instantiate(Pickup, pos, Quaternion.identity);
            Pickups    currentPickup = tmp.GetComponent <Pickups>();

            currentPickup.setPlayer(Player);
            currentPickups.Add(currentPickup);
            PlayerSwarm swarm = Player.GetComponent <PlayerSwarm>();
            //tmp.transform.position = new Vector3(swarm.transform.position.x + swarm.cursor.position.x + 0.2f, swarm.transform.position.y + swarm.cursor.position.y + 0.2f, tmp.transform.position.z);
        }
Exemplo n.º 2
0
        public void Init(PlayerSwarm sw)
        {
            gameObject.layer = LayerMask.NameToLayer("ProjectileUnit");
            rb    = GetComponent <Rigidbody2D>();
            swarm = sw;
            this.transform.GetChild(0).GetChild(0).gameObject.SetActive(true);

            velocity = swarm.bossTransform.position - transform.position;
            velocity.Normalize();

            rb.velocity = Vector2.zero;
            rb.rotation = Vector2.SignedAngle(Vector2.up, velocity.normalized);
            Invoke("FirstAttack", swarm.freezeTime);
        }
Exemplo n.º 3
0
 public void setPlayer(GameObject player)
 {
     playerSwarm = player.GetComponent <PlayerSwarm>();
 }
Exemplo n.º 4
0
 private void Awake()
 {
     rb    = GetComponent <Rigidbody2D>();
     swarm = GetComponentInParent <PlayerSwarm>();
 }