示例#1
0
    public void EquipWeapon(RuntimeWeapon w, bool isLeft = false)
    {
        if (isLeft)
        {
            if (leftHandWeapon != null)
            {
                leftHandWeapon.weaponModel.SetActive(false);
            }

            leftHandWeapon = w;
        }
        else
        {
            if (rightHandWeapon != null)
            {
                rightHandWeapon.weaponModel.SetActive(false);
            }

            rightHandWeapon = w;
        }

        string targetIdle = w.instance.oh_idle;

        targetIdle += (isLeft) ? StaticStrings._l : StaticStrings._r;

        states.anim.SetBool(StaticStrings.mirror, isLeft);
        states.anim.Play(StaticStrings.changeWeapon);
        states.anim.Play(targetIdle);

        UI.QuickSlot uiSlot = UI.QuickSlot.singleton;
        Item         i      = ResourcesManager.singleton.GetItem(w.instance.item_id, ItemType.weapon);

        uiSlot.UpdateSlot((isLeft) ? UI.QSlotType.lh : UI.QSlotType.rh, i.icon);
        w.weaponModel.SetActive(true);
    }
示例#2
0
    public void EquipSpell(RuntimeSpellItem s)
    {
        currentSpell = s;

        UI.QuickSlot uiSlot = UI.QuickSlot.singleton;
        Item         i      = ResourcesManager.singleton.GetItem(s.instance.item_id, ItemType.spell);

        uiSlot.UpdateSlot(UI.QSlotType.spell, i.icon); //pass icon
    }
示例#3
0
    public void EquipConsumable(RuntimeConsumable c)
    {
        currentConsumable = c;

        UI.QuickSlot uiSlot = UI.QuickSlot.singleton;

        Item i = ResourcesManager.singleton.GetItem(c.instance.item_id, ItemType.consum);

        uiSlot.UpdateSlot(UI.QSlotType.item, i.icon);
    }
示例#4
0
 void Awake()
 {
     singleton = this;
 }