Esempio n. 1
0
        private void PickUp()
        {
            if (!IsItemHeld())
            {
                PickupObject pickupObject = _pickupZone.GetPickupObjectInZone();

                if (pickupObject != null)
                {
                    pickupObject.PickUp(_holdingPoint);
                    _heldItem = pickupObject;
                }
            }
        }
    void PickUp()
    {
        weapon = nearbyPickup.GetComponent<PickupObject> ();
        moveCont.anim.SetBool ("Holding", true);
        weapon.PickUp (this.transform);

        armLSR.sprite = armHoldRes;
        armRSR.sprite = armHoldRes;

        Vector3 theScale 	 	  = armR.transform.localScale;
        theScale.x 				 *= -1;
        armR.transform.localScale = theScale;
        arms.transform.position   = armHoldPos.transform.position;

        if(weapon.objName.Equals("rocketlauncher")){
            weaponCurAmmo = weapon.GetComponent<RocketLauncher> ().ammoAmount;
            weaponMaxAmmo = weaponCurAmmo;
        } else if(weapon.objName.Equals("ak47")){
            weaponCurAmmo = weapon.GetComponent<AK47> ().ammoAmount;
            weaponMaxAmmo = weaponCurAmmo;
        } else {
            weaponCurAmmo = 0;
            weaponMaxAmmo = weaponCurAmmo;
        }
    }