Author Topic: UICamera  (Read 105533 times)

Silvalencia

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UICamera
« Reply #30 on: February 11, 2015, 04:05:13 PM »
It's good working

Bradamante3D

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 79
    • View Profile
Re: UICamera
« Reply #31 on: November 26, 2015, 06:35:17 AM »
I don't see the Pan X and Pan Y setting documented anywhere? Not here in the forum documentation, not on the NGUI docs page, not in the class docs. Would be cool if we got an official explanation. I understand these settings are related to setting a scroll bar via a console controller?
#301224014, #301432336, #302399130

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera
« Reply #32 on: December 01, 2015, 07:53:03 AM »
I've added an explanation to the original post.

Diego

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UICamera
« Reply #33 on: December 04, 2015, 12:42:49 PM »
Hi.

One question about the methods OnPress(), OnClick(), OnSelect() ...;
This methods are called every frame like the method Update(), or they are called only once when they are triggered by the camera?

Thanks in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera
« Reply #34 on: December 09, 2015, 01:40:46 PM »
Only when the event gets triggered, and only on the game object that they were triggered on. Doesn't need to be a widget.

Diego

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UICamera
« Reply #35 on: January 17, 2016, 08:13:55 AM »
Thanks for your answer ArenMook.

I understand that then, from a performance point of view, is better to use this methods than the Update method, isn't it?

Thanks again.

The-Arrival

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: UICamera
« Reply #36 on: January 20, 2016, 07:13:56 AM »
Hello ArenMook,

is it possible to easy up your event system, by only implementing certain events in a trigger using interfaces? The Unity EventSystem provides Interfaces: Unity.EventSystem

I found this tutorial on how to only implement certain Events from the system: Tutorial

Is it possible to do something similar with your eventsystem?

Another thing i recognised is that while a mousebutton is pressed, no OnHover is getting triggered. Though for most cases this behavior is totally fine, is it possible to override you event-behaviors with a custom one?
« Last Edit: January 20, 2016, 07:22:07 AM by The-Arrival »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera
« Reply #37 on: January 20, 2016, 08:20:28 AM »
@Diego: The update method? If you mean doing your own Input checks, I would say so, yes.

@The-Arrival: I never liked the interface-based approach personally. From coding point of view it's more neat to not have to derive from some specific class. Much less code too -- no need to register anything either. The performance cost of relying on SendMessage in this case is negligible to the point of being invisible. The only downside is no native way of letting certain events fall through, but that can be remedied inside the desired function itself by forwarding the event to a sub-object if desired.

The full sequence of events when trying to press on something is:
- Hover(true)  <-- Initially hovering over an object
- Press (true)  <-- Pressed on an object
- Press (false) <-- Released the button
- Hover (true) <-- Restoring state to "hover" (won't happen if released outside the object)
- Click

I'm not sure why you'd want to overwrite this with something custom...

The-Arrival

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: UICamera
« Reply #38 on: October 17, 2016, 07:29:20 PM »
Hey...
i have a weired problem lately and no idea were this came from. I´m running Unity 5.4.x and NGUI 3.10.2

Setup:
- I have a UICamera with the EventMask set to the UI Layer
- My MainCamera also has the UICamera Component set to some a "GameObject layer" wich is set on some clickable objects in my scenes.
- I´m in Debug mode to follow which objects get triggered while hover.

In one Scene everything is working as intended: if the mouse is on an UI element, i get the UI-widget. If the button is over an object i get that object. When i hover over nothing i get the root UI object. Thas basically what i want

In a second scene everthing is setup similar, but if i hover nothing it detects the MainCamera itself. The other strange thing (besides two similar scenes have diffrent behaviors) is that the maincamera object is on "default" layer which is not included in any events mask.

Any idea what might be wrong here?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera
« Reply #39 on: October 17, 2016, 10:16:57 PM »
If you want events to go to a specific object when there is no collider hit, set UICamera.fallThrough to your target.

Dune

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: UICamera
« Reply #40 on: October 19, 2016, 12:43:40 PM »
How to get rid of the giant MickyMouse camera in the middle of NGUI's Editor's UI?



Also, how to get custom prefabs to render to the Prefab Toolbar?

Dune

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: UICamera
« Reply #41 on: October 19, 2016, 05:05:40 PM »
Figured out that I could change size of icon via the drop down Gizmos.

asims

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UICamera
« Reply #42 on: September 27, 2018, 07:48:42 AM »
Hello,

we are using multiple displays in our systems. System is working perfect if Camera target display is 1 ( camera means UICamera on the NGUI ). When i change the camera target display 1 to 3 i lost the button events from NGUI. GUI paints but i lost all events. Its working when i return to display 1 ?

Is there any solutins for this  ?

asims

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UICamera
« Reply #43 on: October 02, 2018, 05:01:23 AM »
Hello,

we are using multiple displays in our systems. System is working perfect if Camera target display is 1 ( camera means UICamera on the NGUI ). When i change the camera target display 1 to 3 i lost the button events from NGUI. GUI paints but i lost all events. Its working when i return to display 1 ?

Is there any solutins for this