Author Topic: UICamera.onHover  (Read 2479 times)

Maxii

  • Jr. Member
  • **
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 55
    • View Profile
    • Strategic Forge
UICamera.onHover
« on: February 07, 2016, 09:12:30 AM »
I'm finding circumstances where multiple OnHover(true)s are received on the same object without an intervening OnHover(false). Is this intended?

It is coming from UICamera.ProcessRelease() where your comments suggest you are trying to "restore the visual state of the object", implying of course that an OnHover(false) has already been called and now needs to be restored back to true. This multiple trues in sequence occurs when I click on an object, aka ProcessRelease().

I notice you've commented out sending OnHover(false) from selectedObject.set. The only places I now find it is hoveredObject.set and controllerNavigationObject.set.

I'm guessing this is unintended as I seem to remember encountering a similar issue about 2 years back which you then fixed. :-) Please clarify.

I've been using Ngui now for about 4 years. Wonderful product. Thank you.
I'm looking for an artist partner to complement my programming skill in developing a space-based Civilization-like empire building game, ala GalCiv2 or Distant Worlds based on Unity3D.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera.onHover
« Reply #1 on: February 08, 2016, 01:41:15 AM »
Multiple on hover? As in, consecutive? if so then no, that is not intended. The event stack of a press should be:

OnHover(true)
OnPress(true)
OnSelect (true)
OnPress (false)
OnHover (true)
OnClick

I just double-checked that this is indeed what I receive on my end by adding a Debug.Log in UICamera's Notify() function (inside the if (go && go.activeInHierarchy) block).

Maxii

  • Jr. Member
  • **
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 55
    • View Profile
    • Strategic Forge
Re: UICamera.onHover
« Reply #2 on: February 08, 2016, 08:20:02 AM »
Yes, I do mean 2 OnHover(true)s without an intervening OnHover(false). I do not mean 2 OnHover(true)s without anything else intervening.

The stack you provided shows the issue I'm raising. Shouldn't there be a OnHover(false) in it if there is a second OnHover(true) whos intention is to "restore the visual state" as indicated by the comment?

I think you are telling me that multiple OnHover(true) can arrive on the same object without an intervening OnHover(false), and that it is intended. Please confirm.

One other piece of info: I have the fallthrough GameObject assigned if that matters.

Using latest version 3.9.6d
I'm looking for an artist partner to complement my programming skill in developing a space-based Civilization-like empire building game, ala GalCiv2 or Distant Worlds based on Unity3D.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera.onHover
« Reply #3 on: February 09, 2016, 02:45:34 AM »
Hover state is overwritten by the pressed state. When the press ends, there is a hover state being fired again to restore that state. So yes, it is intentional and has always been like this.