Пример #1
0
    public void DropEquippedItem()
    {
        Debug.Log("drop item: " + currentlyEquippedItem.id);
        if (currentlyEquippedItem.id != equippableItemID.HORSE_ON_LEAD && currentlyEquippedItem.id != equippableItemID.HORSE_MOUNTED)
        {
            currentlyEquippedItem.transform.position = new Vector3(dropItemPos.position.x, dropItemPos.position.y + currentlyEquippedItem.dropPosYOffset, dropItemPos.position.z);
        }
        currentlyEquippedItem.transform.SetParent(null);

        currentlyEquippedItem.BeDropped();

        if (currentlyEquippedItem.id == equippableItemID.HORSE_ON_LEAD)
        {
            Horse_Interactable horseInt = currentlyEquippedItem.GetComponent <Horse_Interactable> ();
            if (horseInt.headGear.type == horseGearType.HALTER)
            {
                horseInt.LeadIsDropped(this);
            }
            else if (horseInt.headGear.type == horseGearType.BRIDLE)
            {
                horseInt.StopLeadingHorseByReins(this);
            }
        }
        else if (currentlyEquippedItem.id == equippableItemID.HORSE_MOUNTED)
        {
            Horse_Interactable horseInt = currentlyEquippedItem.GetComponent <Horse_Interactable> ();
            horseInt.Dismount(this);
            currentMovementSet = playerMovementSet.WALKING;
        }

        maximumTurnRate = defaultMaximumTurnRate;
        Debug.Log("calling removeitem from Drop");
        inventory.RemoveActiveItemFromInventory(currentlyEquippedItem);
        currentlyEquippedItem = playerHands;
    }
Пример #2
0
 public void MountHorse(Horse_RidingBehavior mountedHorse)
 {
     currentMovementSet = playerMovementSet.RIDING;
     nearestHorse       = mountedHorse.horse;
 }