well, that was so useful.
but there is an error ... when the spell is equipped, the spell cannot be moved to the skill.
and also when I abuse the system; like when I click many times on the skill, it keeps duplicating and nothing happens (no animation nor partical effect runs).
and in the photo (after I abuse the system) the spell stuck in the inventory item set manager.
here are the errors:
99 Life shot (2375888137) || ItemCollection Default (Main) || ItemStack(458974336)[ 99 Life shot (2375888137) in ItemCollection Default (Main)] cannot be moved to default because it was equitable.
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveItemToDefault (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,int) (at Assets/External/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:490)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,int,bool) (at Assets/External/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:535)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterUseItemAction:OnItemAbilityActive (Opsive.UltimateCharacterController.Character.Abilities.Items.ItemAbility,bool) (at Assets/External/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryItemActions/CharacterUseItemAction.cs:124)
Opsive.Shared.Events.InvokableAction`2<Opsive.UltimateCharacterController.Character.Abilities.Items.ItemAbility, bool>:Invoke (Opsive.UltimateCharacterController.Character.Abilities.Items.ItemAbility,bool)
Opsive.Shared.Events.EventHandler:ExecuteEvent<Opsive.UltimateCharacterController.Character.Abilities.Items.ItemAbility, bool> (object,string,Opsive.UltimateCharacterController.Character.Abilities.Items.ItemAbility,bool)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:TryStopAbility (Opsive.UltimateCharacterController.Character.Abilities.Ability,bool) (at Assets/External/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1459)
Opsive.UltimateCharacterController.Character.Abilities.Ability:StopAbility (bool,bool) (at Assets/External/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:695)
Opsive.UltimateCharacterController.Character.Abilities.Ability:StopAbility () (at Assets/External/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:672)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use:UseCompleteItem (int) (at Assets/External/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:836)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use:OnItemUseComplete () (at Assets/External/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:766)
Opsive.Shared.Events.InvokableAction:Invoke ()
Opsive.Shared.Events.EventHandler:ExecuteEvent (object,string)
Opsive.UltimateCharacterController.Character.AnimatorMonitor:ExecuteEvent (string) (at Assets/External/Opsive/UltimateCharacterController/Scripts/Character/AnimatorMonitor.cs:940)
72 Life shot (2710108003) || ItemCollection Skills (Main) || ItemStack is NULL cannot be moved to equippable because it was not in default first.
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveItemToEquippable (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,int) (at Assets/External/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:425)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,int,bool) (at Assets/External/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:532)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterUseItemAction:InvokeActionInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.ItemActions.ItemUser) (at Assets/External/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryItemActions/CharacterUseItemAction.cs:95)
Opsive.UltimateInventorySystem.ItemActions.ItemAction:InvokeAction (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.ItemActions.ItemUser) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:97)
Opsive.UltimateInventorySystem.ItemActions.MultiItemAction:InvokeActionInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.ItemActions.ItemUser) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/ItemActions/MultiItemAction.cs:60)
Opsive.UltimateInventorySystem.ItemActions.ItemAction:InvokeAction (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.ItemActions.ItemUser) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:97)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerItemActionBindingBase:InvokeActionInternal (int,int) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerItemActionBindingBase.cs:267)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerCategoryItemActionSetBinding:UseItemAction (int,int) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerCategoryItemActionSetBinding.cs:97)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerItemActionBindingBase:TriggerItemAction (Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerItemActionBindingBase.cs:179)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerItemActionBindingBase:TriggerItemAction (int) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerItemActionBindingBase.cs:160)
Opsive.UltimateInventorySystem.UI.Panels.Hotbar.ItemHotbar:UseItem (int) (at Assets/External/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Hotbar/ItemHotbar.cs:92)
Opsive.UltimateInventorySystem.UI.Panels.Hotbar.ItemHotbarHandler:Update () (at Assets/External/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Hotbar/ItemHotbarHandler.cs:77)
And here is my code:
C#:
using Opsive.UltimateInventorySystem.Core;
using Opsive.UltimateInventorySystem.Core.DataStructures;
using Opsive.UltimateInventorySystem.ItemActions;
using System;
using UnityEngine;
[Serializable]
public class SentMagicItemsToSkillsInventory : Opsive.UltimateInventorySystem.ItemActions.ItemAction
{
[SerializeField] protected uint m_playerInvetoryID;
[SerializeField] protected uint m_skillInvetoryID;
protected override bool CanInvokeInternal(ItemInfo itemInfo, ItemUser itemUser)
{
/*
if (itemInfo.Item.Category.name == "Magic")
{
return true;
}
return false;
*/
return true;
}
protected override void InvokeActionInternal(ItemInfo itemInfo, ItemUser itemUser)
{
var playerInventoryIdentifier = InventorySystemManager.GetInventoryIdentifier(m_playerInvetoryID);
var playerInventory = playerInventoryIdentifier.Inventory;
var skillInventoryIdentifier = InventorySystemManager.GetInventoryIdentifier(m_skillInvetoryID);
var skillInventory = skillInventoryIdentifier.Inventory;
playerInventory.RemoveItem(itemInfo);
skillInventory.AddItem(itemInfo);
/*
Debug.Log("playerInventory" + playerInventory);
Debug.Log("skillInventory" + skillInventory);
*/
}
}