Custom code when using the grid system?

I havent ran into instructions on this yet, but in my game you go around collecting clothing sets and I want this inventory to collect these outfits as options. Then when the player can get to a dresser on level 1 and level 6 they can change their clothes with these options. They never need to be removed from inventory and thats alot of examples I see, how to remove stuff from inventory, anyways when the player clicks on one of the items they have picked up in inventory I need it to run custom scripts from there. How would I go about this? Thanks!
 
Ok finally found the right tutorial on this and an old forum link. Ive got this working using a simple line of code in your item actions.
Code:
using Opsive.UltimateInventorySystem.ItemActions;
using Opsive.UltimateInventorySystem.Core.AttributeSystem;
using Opsive.UltimateInventorySystem.Core.DataStructures;
using UnityEngine;

[System.Serializable]
public class BlackNightieInventory : ItemAction
{   
    public GameObject AlliAvatar;
    /// <summary>
    /// Can the item action be invoked.
    /// </summary>
    /// <param name="itemInfo">The item info.</param>
    /// <param name="itemUser">The item user (can be null).</param>
    /// <returns>True if it can be invoked.</returns>
    protected override bool CanInvokeInternal(ItemInfo itemInfo, ItemUser itemUser)
    {
        // Return true if the item can be invoked or false if it cannot.
        return true;
    }

    /// <summary>
    /// Consume the item.
    /// </summary>
    /// <param name="itemInfo">The item info.</param>
    /// <param name="itemUser">The item user (can be null).</param>
    protected override void InvokeActionInternal(ItemInfo itemInfo, ItemUser itemUser)
    {       
        AlliAvatar.GetComponent<DRClothingTransitions>().BlackNightieDelay();       
    }   
}

Thanks to this old forum post as well.
 
Yeah its definitely a complete asset. Was taking me alot more time than expected to go through it all. All I needed was an inventory grid panel and the ability to access and code to it. Rest of my game is already coded with specific coding for swapping clothing and picking up objects etc. So its taking me some time to get through it all. Thanks!
 
Top