コード例 #1
0
 public void Activate(MasterInventory_Class inventory)
 {
     if (inventory.EquippedRangedWeaponScipt != null && inventory.readyToEquip == true)
     {
         SwapWeapon(inventory);
     }
 }
コード例 #2
0
    } //////

    //Pick up this weapon
    public override void Activate(MasterInventory_Class inventory)
    {
        if (inventory.readyToEquip == true)
        {
            MoveToPosition(inventory.RangedWeaponPosition);
            inventory.EquipNewRangedWeapon(this);
            TurnOffInteraction();
        }
    }
コード例 #3
0
 public override void Activate(MasterInventory_Class inventory)
 {
     if (waitingToDie == false && inventory.readyToEquip == true)
     {
         TurnOffInteraction();
         inventory.EquipNewThrowable(this);
         MoveToPosition(inventory.ThrowablePosition);
     }
 }
コード例 #4
0
    public void SwapWeapon(MasterInventory_Class inventory)
    {
        RangedWeapon_Class WeaponToGive = EquippedRangedWeapon;
        RangedWeapon_Class WeaponToTake = inventory.EquippedRangedWeaponScipt;

        int x = 0;

        foreach (RangedWeapon_Class w in inventory.RangedWeapons)
        {
            if (w != null)
            {
                if (WeaponToGive.weaponName == w.weaponName)
                {
                    x++;
                }
            }
        }

        if (x > 0)
        {
            Debug.Log("hit case 1");
            //Do nothing
            //Make this destroy the weapon we dont want anymore later.
        }

        else
        {
            Debug.Log("hit case 2");


            //give old weapon to the player
            //move to position
            //equip new weapon
            //move to posiiton
            inventory.DropRangedWeapon(WeaponToTake);

            WeaponToGive.MoveToPosition(inventory.RangedWeaponPosition);
            inventory.EquipNewRangedWeapon(WeaponToGive);

            WeaponToTake.gameObject.SetActive(true);

            WeaponToTake.MoveToPosition(GunPosition);
            Debug.Log("Moved Weapon to correct spot");

            EquippedRangedWeapon = WeaponToTake;
            Debug.Log("Replaced old weapon");

            EquippedRangedWeapon.TurnOffInteraction();
        }
    }
コード例 #5
0
 public virtual void FacilityEffect(MasterInventory_Class inventory)
 {
 }
コード例 #6
0
 public void Activate(MasterInventory_Class inventory)
 {
     FacilityEffect(inventory);
 }
コード例 #7
0
    //Each weapon uses this to be picked up
    public virtual void Activate(MasterInventory_Class inventory)
    {

    }