Exemplo n.º 1
0
    void OnTriggerStay2D(Collider2D coll)
    {
        if (coll.gameObject.tag == "Player")
        {
            //makes player take damage on contact with mine
            WeaponAttack waScript = coll.gameObject.GetComponent <WeaponAttack>();
            GunScript    currWep  = waScript.getCurr().GetComponent <GunScript>();
            currWep.bulletLeft += (clipNum * currWep.clipSize);
            currWep.setAmmoCounter();

            gameObject.SetActive(false);
        }
    }
Exemplo n.º 2
0
 void OnTriggerStay2D(Collider2D coll)
 {
     if (coll.gameObject.tag == "Player" && Input.GetKeyDown(KeyCode.E))
     {
         Debug.Log("Player picked up " + weaponName);
         if (wa.getCurr() != null)
         {
             wa.DropWeapon();
         }
         wa.setWeapon(this.gameObject, weaponName);
         this.gameObject.SetActive(false);
     }
 }