In my inventory system, items could take more than one slot.
A slot prefab has:
1- UIButton script attached to it.
2- A 'background' as a child, which has a UISprite script attached to it.
3- An 'icon' as a child, which also has a UISprite script attached to it.
The way I setup the 'items take more than one slot' system, is that when I place an item in a place where it fits, I take the first slot background and icon and enlarge them to meet the item's dimensions, and for the rest of the slots it took, I disable their background and icon, take a look at the attachments.
But notice, I don't enlarge the collider to meet the item's dimensions, I leave the slots colliders to detect which slot I'm clicking at (I enlarge them a bit just to close down the spaces between the slots which will be left without a collider), this means, if I hover over a slot, other than the top-left one, the item won't highlight! - which is why whenever I add an item to some place, I make all its required slots 'refer to' the top-left one, and when I do that, I change their tween target, so that if I hover over any slot, the background of the top-left slot will get highlighted.
public Slot ReferTo
{
get { return referTo; }
set
{
referTo = value;
// if I'm referring to myself, my target tween is my background
if (referTo == this)
_button.tweenTarget = background.gameObject;
// else my target tween is the bg of what I'm 'referring to'
else _button.tweenTarget = referTo.background.gameObject;
}
}
This all works well, however the problem arises when I pickup/hold the item with my mouse, when I do so, I free the slots that the item has taken (of course, when a slot is free, it 'refers to' itself now, which means its target tween is its background), when I do that, the slot I originally clicked on to add the item, will still have its highlight on! Refer to the "TheProblem" attachment.
PLEASE help me fix this, been struggling for about a week! I can't make progress cuz I'm stuck

(( - Do I have to mess with the UIButton script's code?
Thanks a lot for the help, I would really appreciate it.