public void ClearInventorySlot() { item = null; icon.sprite = null; icon.enabled = false; gameObject.SetActive(false); }
public void ChangeLeftWeapon() { currentLeftWeaponIndex = currentLeftWeaponIndex + 1; if (currentLeftWeaponIndex == 0 && weaponsInLeftHandSlots[0] != null) { leftWeapon = weaponsInLeftHandSlots[currentLeftWeaponIndex]; weaponSlotManager.LoadWeaponOnSlot(weaponsInLeftHandSlots[currentLeftWeaponIndex], true); } else if (currentLeftWeaponIndex == 0 && weaponsInLeftHandSlots[0] == null) { currentLeftWeaponIndex = currentLeftWeaponIndex + 1; } else if (currentLeftWeaponIndex == 1 && weaponsInLeftHandSlots[1] != null) { leftWeapon = weaponsInLeftHandSlots[currentLeftWeaponIndex]; weaponSlotManager.LoadWeaponOnSlot(weaponsInLeftHandSlots[currentLeftWeaponIndex], true); } else { currentLeftWeaponIndex = currentLeftWeaponIndex + 1; } if (currentLeftWeaponIndex > weaponsInLeftHandSlots.Length - 1) { currentLeftWeaponIndex = -1; leftWeapon = unarmedWeapon; weaponSlotManager.LoadWeaponOnSlot(unarmedWeapon, true); } }
public void AddItem(WeaponItem newItem) { item = newItem; icon.sprite = item.itemIcon; icon.enabled = true; gameObject.SetActive(true); }
public void LoadWeaponOnSlot(WeaponItem weaponItem, bool isLeft) { if (isLeft) { leftHandSlot.LoadWeaponModel(weaponItem); LoadLeftWeaponDamageCollider(); quickSlotsUI.UpdateWeaponQuickSlotsUI(true, weaponItem); if (weaponItem != null) { animator.CrossFade(weaponItem.left_hand_idle, 0.2f); } else { animator.CrossFade("Left Arm Empty", 0.2f); } } else { rightHandSlot.LoadWeaponModel(weaponItem); LoadRightWeaponDamageCollider(); //quickSlotsUI.UpdateWeaponQuickSlotsUI(false, weaponItem); if (weaponItem != null) { animator.CrossFade(weaponItem.right_hand_idle, 0.2f); } else { animator.CrossFade("Right Arm Empty", 0.2f); } } }
public void ChangeRightWeapon() { currentRightWeaponIndex = currentRightWeaponIndex + 1; if (currentRightWeaponIndex == 0 && weaponsInRightHandSlots[0] != null) { rightWeapon = weaponsInRightHandSlots[currentRightWeaponIndex]; weaponSlotManager.LoadWeaponOnSlot(weaponsInRightHandSlots[currentRightWeaponIndex], false); } else if (currentRightWeaponIndex == 0 && weaponsInRightHandSlots[0] == null) { currentRightWeaponIndex = currentRightWeaponIndex + 1; } else if (currentRightWeaponIndex == 1 && weaponsInRightHandSlots[1] != null) { rightWeapon = weaponsInRightHandSlots[currentRightWeaponIndex]; weaponSlotManager.LoadWeaponOnSlot(weaponsInRightHandSlots[currentRightWeaponIndex], false); } else { currentRightWeaponIndex = currentRightWeaponIndex + 1; } if (currentRightWeaponIndex > weaponsInRightHandSlots.Length - 1) { currentRightWeaponIndex = -1; rightWeapon = unarmedWeapon; weaponSlotManager.LoadWeaponOnSlot(unarmedWeapon, false); } }
public void LoadWeaponModel(WeaponItem weaponItem) { UnloadWeaponAndDestroy(); if (weaponItem == null) { UnloadWeapon(); return; } GameObject model = Instantiate(weaponItem.modelPrefab) as GameObject; if (model != null) { if (parentOverride != null) { model.transform.parent = parentOverride; } else { model.transform.parent = transform; } model.transform.localPosition = Vector3.zero; model.transform.localRotation = Quaternion.identity; model.transform.localScale = Vector3.one; } currentWeaponModel = model; }
public void UpdateWeaponQuickSlotsUI(bool isLeft, WeaponItem weapon) { if (isLeft == false) { if (weapon.itemIcon != null) { rightWeaponIcon.sprite = weapon.itemIcon; rightWeaponIcon.enabled = true; } else { rightWeaponIcon.sprite = null; rightWeaponIcon.enabled = false; } } else { if (weapon.itemIcon != null) { leftWeaponIcon.sprite = weapon.itemIcon; leftWeaponIcon.enabled = true; } else { leftWeaponIcon.sprite = null; leftWeaponIcon.enabled = false; } } }
public void ClearItem() { weapon = null; icon.sprite = null; icon.enabled = false; gameObject.SetActive(false); }
public void AddItem(WeaponItem newWeapon) { weapon = newWeapon; icon.sprite = weapon.itemIcon; icon.enabled = true; gameObject.SetActive(true); }
private void Start() { rightWeapon = weaponsInRightHandSlots[0]; leftWeapon = weaponsInLeftHandSlots[0]; weaponSlotManager.LoadWeaponOnSlot(rightWeapon, false); weaponSlotManager.LoadWeaponOnSlot(leftWeapon, true); rightWeapon = weaponsInRightHandSlots[currentRightWeaponIndex]; leftWeapon = weaponsInLeftHandSlots[currentLeftWeaponIndex]; weaponSlotManager.LoadWeaponOnSlot(rightWeapon, false); weaponSlotManager.LoadWeaponOnSlot(leftWeapon, true); }
public void HandleWeaponCombo(WeaponItem weapon) { if (inputHandler.comboFlag) { animatorHandler.anim.SetBool("canDoCombo", false); if (lastAttack == weapon.OH_Light_Attack_1) { animatorHandler.PlayTargetAnimation(weapon.OH_Light_Attack_1, true); } } }
public void HandleHeavyAttack(WeaponItem weapon) { weaponSlotManager.attackingWeapon = weapon; animatorHandler.PlayTargetAnimation(weapon.OH_Heavy_Attack_1, true); lastAttack = weapon.OH_Light_Attack_1; }