Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: you_inoue on July 08, 2014, 01:41:29 AM

Title: SpringPosition of onFinished
Post by: you_inoue on July 08, 2014, 01:41:29 AM
Hi!
I am using NGUI3.6.7.

It's has a SpringPosition with the UIDragObject.keepVisible but does not take the events at the end.
We put value to SpringPosition.onFinished in advance, but below has ended up being overwritten due.

  1. SpringPosition.Begin(Line137)
  2. ----------------------------------------------------------------------
  3. sp.onFinished = null;
  4. ----------------------------------------------------------------------
  5.  

How do I cope?
Title: Re: SpringPosition of onFinished
Post by: ArenMook on July 08, 2014, 12:09:45 PM
SpringPosition.Begin clears everything intentionally. If you have an existing tween, GetComponent<SpringPosition>().enabled = true.
Title: Re: SpringPosition of onFinished
Post by: you_inoue on July 09, 2014, 02:13:21 AM
When SpringPosition exists, can it prevent from clearing onFinished?
Title: Re: SpringPosition of onFinished
Post by: ArenMook on July 09, 2014, 05:00:54 PM
It doesn't clear it. It's only cleared if you do SpringPosition.Begin. As I mentioned in the previous post, if you don't use the Begin() function, you won't have issues.
Title: Re: SpringPosition of onFinished
Post by: you_inoue on July 11, 2014, 04:45:38 AM
SpringPosition.Begin() is not used explicitly.

  1. UICamera.Notify(Line922)
  2. go.SendMessage(funcName, obj, SendMessageOptions.DontRequireReceiver);
  3. UIDragObject.OnPress(Line170)
  4. if (mPanel.ConstrainTargetToBounds(target, ref mBounds, false))
  5. UIPanel.ConstrainTargetToBounds(Line1681)
  6. SpringPosition sp = SpringPosition.Begin(target.gameObject, target.localPosition + offset, 13f);
  7. sp.ignoreTimeScale = true;
  8. sp.worldSpace = false;
  9.  

I want to do.
1. I move the window.
2. I do not take out the window outside a screen.
3. Get the final position of the window in order to store the position of the window.

1 = UIDragObject
2 = UIDragObject.keepVisible = true(SpringPosition)
3 = SpringPosition.onFinish

I want to use SpringPosition but can not be realized.
Is there any other way?
Title: Re: SpringPosition of onFinished
Post by: ArenMook on July 11, 2014, 08:27:17 PM
The problem lies in the fact that you seem to want to have a tween on the same game object that gets tweened by NGUI's actions. Either create two objects, and put your tween on the second object, or use different group IDs.

If the Tween Group is not 0, it won't be picked up by TweenXXX.Begin.