Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Maxii

Pages: 1 [2]
16
NGUI 3 Support / Event forwarding
« on: August 29, 2013, 04:48:09 PM »
I'm struggling with how to forward events to their targeted game object from a FallthruEventHandler attached to my main 3D UICamera. I've successfully implemented the handler that gives me a copy of all UICamera events except those that go to my Gui layer (handled by a separate 2D UICamera on that layer). The main UICamera's EventReceiverMask is set to nothing like you did in Windward. I can see them arriving just like you said. What I can't figure out is which game objects they should be forwarded too and how to do it. UICamera.hoveredObject always points to the FallthruEventHandler which makes sense as there never was a hit on a gameObject collider, due to the eventMask. Without a hit on the game object being recorded in hoveredObject, how do you know who you were attempting to talk too?

I expect the answer will cause me to be :-[, but I'm at the point where I have to ask. What am I missing?

17
NGUI 3 Support / OnLeftClick
« on: August 19, 2013, 10:06:25 AM »
I'm using all the UIButton XXX scripts (including UIButton Play Animation, Sound) on NGUI buttons with an OnClick trigger. As currently implemented in these core Ngui classes, any Mouse Button Click over the button actuates OnClick().

My objective is to limit this actuation to just the left mouse button.  As I want to continue to incorporate Ngui updates and bug fixes, I don't want to modify these Ngui core classes, so how do I limit these core Ngui button scripts to just the left mouse click? I thought to just override those methods but the OnClick() methods in the Play Animation and Sound classes are private, so I can't.

18
NGUI 3 Support / UIEventListener vs OnClick
« on: August 18, 2013, 04:53:23 PM »
I'm curious. I've used both

  1. UIEventListener.Get(thisGameobject).onClick += MyOnClickMethod;
  2. void MyOnClickMethod(GameObject sender) { // do something }

and

  1. void OnClick() { MyOnClickMethod() }
  2. void MyOnClickMethod() { // do something }

to interact with Ngui events. What are the differences, advantages/disadvantages, etc.?

btw, Great product! Can't wait to see what you do with Unity's next gen GUI!



19
On 2.3.1, for both UICheckbox and UISlider, current is not updated to this when using a delegate rather than the Event Receiver callback system.

20
NGUI 3 Support / UISlider delegate OnValueChanged
« on: February 02, 2013, 08:55:20 AM »
I want to use the delegates for event notification that were added in 2.1.3. While I see how to use
those in UIEventListener [UIEventListener.Get(goWantingToReceiveEvent).event += eventHandler;], I don't
see how to use the one now included in UISlider, aka OnValueChanged(float).

Edit: I figured it out. remoteSliderScript.onValueChanged += LocalHandlerForSliderOnValueChanged;

21
NGUI 3 Support / LagPosition
« on: July 03, 2012, 02:13:46 PM »
Just bought NGUI!

Looking at the code for LagPosition, I'm confused as to why you place your Lerp method in a CoRoutine rather than in LateUpdate when you don't want elapsed time to be included.

I'm also not clear on the point of a CoRoutine that doesn't include a Yield statement.

Finally, I can see that placing the Lerp function in LateUpdate causes it to be continuously executed each frame, but placing it in a coroutine would seem to only run once as it would complete when the Lerp method completed the first time...

Obviously I'm confused on something rather basic but I've searched for hours on the subject without joy. :-(

Thanks for the clarification.

Pages: 1 [2]