Пример #1
0
    public void OnPointerEnter(PointerEventData eventData)
    {
        string name        = "";
        string description = "";

        if (Equipped == false)
        {
            Inventory.Item item = Inventory.Items[Index];
            if (item.type == Inventory.ItemType.ability)
            {
                PlayerController.Ability ability = PlayerController.AbilityInformation.abilities[item.id];
                name        = ability.name;
                description = ability.description;
            }
            else if (item.type == Inventory.ItemType.weapon)
            {
                PlayerController.Weapon weapon = PlayerController.WeaponInformation.weapons[item.id];
                name        = weapon.name;
                description = weapon.description;
            }
        }
        else
        {
            // If equipped, read from equipped items
            if (Type == Inventory.ItemType.ability)
            {
                PlayerController.Ability ability = PlayerController.Abilities[SlotNumber];
                name        = ability.name;
                description = ability.description;
            }
            else if (Type == Inventory.ItemType.weapon)
            {
                PlayerController.Weapon weapon = PlayerController.CurrentWeapon;
                name        = weapon.name;
                description = weapon.description;
            }
        }
        ItemInformation.SetDisplay(name, description);
    }
Пример #2
0
 public void SetChosenWeapon(int weapon)
 {
     chosenWeapon = (PlayerController.Weapon)weapon;
 }