Forum rules - please read before posting.

OnMouseOverMenu return wrong slot number?

I do not know if this is really an issue.
I have noticed a strange behavior by working on the OnMouseOverMenu Custom Event and UI Inventory.
I needed to read the slot on which the cursor  (or the item taken) was located and I saw that "int _slot" always returns zero when the cursor is on the inventory edge (and out of the slot).
Because of this wrong value if the code in the OnMouseOverMenu needs to evaluate where the cursor is located, it will always be on the zero slot instead of just coming out of slots 2 or 3 and so on.
I do not know if it is possible but maybe it would be more correct to return for example -1.





Comments

  • The slot number is only of worth if the element parameter is not null.  You can just check for that in lieu of the slot number:

    if (_element != null)
    {
      Debug.Log ("Over element " + _element.title + ", Slot: " + _slot);
    }
    else
    {
      Debug.Log ("Not over an element.");
    }

  • Thanks Chris!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.