Files
FueraDeEscala/Assets/Game Kit Controller/Scripts/Inventory/Inventory Pickups Behaviour/meleeWeaponConsumableOnInventory.cs
Robii Aragon 779f2c8b20 add ckg
plantilla base para movimiento básico
2026-02-05 05:07:55 -08:00

41 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class meleeWeaponConsumableOnInventory : objectOnInventory
{
public bool showDebugPrint;
public meleeWeaponConsumablePickup mainMeleeWeaponConsumablePickup;
public override void activateUseObjectActionOnInventory (GameObject currentPlayer, int amountToUse)
{
playerComponentsManager currentPlayerComponetsManager = currentPlayer.GetComponent<playerComponentsManager> ();
if (currentPlayerComponetsManager != null) {
grabbedObjectMeleeAttackSystem currentGrabbedObjectMeleeAttackSystem = currentPlayerComponetsManager.getGrabbedObjectMeleeAttackSystem ();
if (currentGrabbedObjectMeleeAttackSystem != null) {
if (currentGrabbedObjectMeleeAttackSystem.setDamageTypeAndReactionInfo (mainMeleeWeaponConsumablePickup.weaponConsumableName)) {
checkExternalElementsOnUseInventoryObject (currentPlayer);
} else {
amountToUse = 0;
}
}
}
inventoryManager currentInventoryManager = currentPlayer.GetComponent<inventoryManager> ();
if (currentInventoryManager != null) {
currentInventoryManager.setUseObjectWithNewBehaviorResult (amountToUse);
if (closeInventoryOnObjectUsed && amountToUse > 0) {
if (currentInventoryManager.isInventoryMenuOpened ()) {
currentInventoryManager.openOrCloseInventory (false);
}
}
}
}
}