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); }
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 }
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); }
void Awake() { singleton = this; }