Author Topic: UIPlayTween not sending OnComplete when UICamera Disabled  (Read 1378 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
UIPlayTween not sending OnComplete when UICamera Disabled
« on: June 15, 2017, 01:34:24 PM »
Hello.  I'm new to NGUI and have inherited some code.  After some digging I *think* I'm on a bug in NGUI?

I have some code that programmatically Tweens In and Tweens Out a GameObject hierarchy of NGUI widgets.  On Tween Out, we'd like to disable input during the tween.  However when we disable the camera, we never see the OnComplete:

  1.         uiCamera.enabled = false;
  3.         outTweener.enabled = true;
  4.         outTweener.onFinished.Add(new EventDelegate(this, "OnTweenFinished"));
  5.         outTweener.Play(false);

If we do not disable the camera, OnTweenFinished will be played.  Hmm.

A few more details:
* this is new with our upgrade from 3.7.4 to 3.11.4.  Although we were getting sporadic "GUI lockups" in the past that we seem to be avoiding by not disabling the camera.  But one can never be sure.  With the upgrade we are seeing this always.
* The Tween In code is working even when the camera is disabled.  It runs programatically also.  There is an exit button which calls to Tween Out.

Thanks for any ideas!


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPlayTween not sending OnComplete when UICamera Disabled
« Reply #1 on: June 18, 2017, 07:24:59 PM »
You should not be disabling the UICamera. If you want to prevent input, UICamera.ignoreAllEvents = true;