AC or Unity UI-based menu?
This should already be the case, so long as Items can be re-ordered in Menu? is unchecked in the Settings Manager's "Inventory settings" panel.
Otherwise, you can hook into the OnInventoryRemove custom event to modify the list of inventory items directly:
using UnityEngine; using System.Collections; using AC; public class ClearEmptyInventorySlots : MonoBehaviour { private void OnEnable () { EventManager.OnInventoryRemove += OnRemoveInventory; } private void OnDisable () { EventManager.OnInventoryRemove -= OnRemoveInventory; } private void OnRemoveInventory (InvItem _item, int value) { KickStarter.runtimeInventory.localItems.RemoveAll (delegate (InvItem o) { return o == null; }); } }
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
AC or Unity UI-based menu?
This should already be the case, so long as Items can be re-ordered in Menu? is unchecked in the Settings Manager's "Inventory settings" panel.
Otherwise, you can hook into the OnInventoryRemove custom event to modify the list of inventory items directly: