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.


Messages - you_inoue

Pages: [1]
1
NGUI 3 Support / Re: EventDelegate.Execute()
« on: October 23, 2014, 11:02:21 PM »
Can not be used in UIPlayTween. :'(
OK!
Thank you! :) :)

2
NGUI 3 Support / Re: EventDelegate.Execute()
« on: October 21, 2014, 12:39:58 AM »
This is.

  1. // PlayTweenTest.cs
  2.  
  3. using UnityEngine;
  4. using System.Collections;
  5.  
  6. [RequireComponent(typeof(UIPlayTween))]
  7. public class PlayTweenTest : MonoBehaviour
  8. {
  9.         UIPlayTween pt;
  10.         void Start()
  11.         {
  12.                 if (pt == null)
  13.                         pt = GetComponent<UIPlayTween>();
  14.                 TweenPosition.Begin(gameObject, 5f, new Vector3(1f, 0f, 0f));
  15.                 EventDelegate.Set(pt.onFinished, OnFinish1); // before Add
  16.                 pt.Play(true);
  17.         }
  18.         void OnFinish1()
  19.         {
  20.                 Debug.Log("OnFinish1");
  21.                 EventDelegate.Set(pt.onFinished, OnFinish2); // before Add
  22.                 pt.Play(false);
  23.         }
  24.         void OnFinish2()
  25.         {
  26.                 Debug.Log("OnFinish2");
  27.         }
  28. }
  29.  

1.New Scene.
2.Create GameObject.
3.GameObject AddComponent PlayTweenTest.cs
4.Scene Play.

It is possible to confirm it.

Now NGUI3.7.4.

3
NGUI 3 Support / Re: EventDelegate.Execute()
« on: October 19, 2014, 10:58:22 PM »
The problem is not settled.
Besides, there is not OneShot.
"OnFinish2" two times are called.

4
NGUI 3 Support / Re: EventDelegate.Execute()
« on: October 16, 2014, 07:51:07 AM »
Different frame? What do you mean?

As long as you have a non-duration delay, it'll work as expected.

If your duration is zero then don't bother using a tween at all.

Update NGUI3.7.4.
There was a problem.
duration = 5.0f
 :'( :'(

  1. // Same frame
  2. IEnumerator SameFrame()
  3. {
  4.     pt.Play(true);
  5.     EventDelegate.Add(pt.onFinished, OnFinish1, true);
  6.     yield return null;
  7. }
  8. // Different frame
  9. IEnumerator DifferentFrame()
  10. {
  11.     pt.Play(true);
  12.     yield return null;
  13.     EventDelegate.Add(pt.onFinished, OnFinish1, true);
  14. }
  15.  

5
NGUI 3 Support / Re: EventDelegate.Execute()
« on: October 16, 2014, 06:38:42 AM »
This?
  1. [RequireComponent(typeof(UIPlayTween))]
  2. public class PlayTweenTest : MonoBehaviour
  3. {
  4.     UIPlayTween pt;
  5.     void Start()
  6.     {
  7.         if (pt == null)
  8.             pt = GetComponent<UIPlayTween>();
  9.         TweenPosition.Begin(gameObject, 5f, new Vector3(1f, 0f, 0f));
  10.         pt.Play(true); // first
  11.         EventDelegate.Add(pt.onFinished, OnFinish1, true); // second
  12.     }
  13.     void OnFinish1()
  14.     {
  15.         Debug.Log("OnFinish1");
  16.         pt.Play(false); // first
  17.         EventDelegate.Add(pt.onFinished, OnFinish2, true); // second
  18.     }
  19.     void OnFinish2()
  20.     {
  21.         Debug.Log("OnFinish2");
  22.     }
  23. }
  24.  
There was a problem.
"Play()" and "add/set", It performs with a different frame?

6
NGUI 3 Support / EventDelegate.Execute()
« on: October 15, 2014, 03:40:39 AM »
Hi!
I am using NGUI3.6.8.

Run the code below.
"OnFinish2" is called at the time of "OnFinish1."

  1. [RequireComponent(typeof(UIPlayTween))]
  2. public class PlayTweenTest : MonoBehaviour
  3. {
  4.         UIPlayTween pt;
  5.         void Start()
  6.         {
  7.                 if (pt == null)
  8.                         pt = GetComponent<UIPlayTween>();
  9.                 TweenPosition.Begin(gameObject, 5f, new Vector3(1f, 0f, 0f));
  10.                 EventDelegate.Add(pt.onFinished, OnFinish1, true);
  11.                 pt.Play(true);
  12.         }
  13.         void OnFinish1()
  14.         {
  15.                 Debug.Log("OnFinish1");
  16.                 EventDelegate.Add(pt.onFinished, OnFinish2, true);
  17.                 pt.Play(false);
  18.         }
  19.         void OnFinish2()
  20.         {
  21.                 Debug.Log("OnFinish2");
  22.         }
  23. }
  24.  

The cause is "EventDelegate.Execute" of for statement.
for statement running, list change, It is not to operate as expected.
I was changed to a secure code.

There was a problem.
"UITweener.duration = 0".
"OnFinish2" is not called.

It was troubled. :'(

  1. EventDelegate.Execute
  2. ----------------------------------------------------------------------
  3. [NGUI3.6.8]
  4. for (int i = 0; i < list.Count; )
  5. {
  6.         EventDelegate del = list[i];
  7.  
  8.         if (del != null)
  9.         {
  10.                 del.Execute();
  11.  
  12.                 if (i >= list.Count) break;
  13.                 if (list[i] != del) continue;
  14.  
  15.                 if (del.oneShot)
  16.                 {
  17.                         list.RemoveAt(i);
  18.                         continue;
  19.                 }
  20.         }
  21.         ++i;
  22. }
  23. ----------------------------------------------------------------------
  24. [Change]
  25. foreach (var del in list.ToArray())
  26. {
  27.         if (del != null)
  28.         {
  29.                 del.Execute();
  30.                 if (del.oneShot)
  31.                         list.Remove(del);
  32.         }
  33. }
  34. ----------------------------------------------------------------------
  35.  

7
NGUI 3 Support / Re: UICenterOnChild of onDragFinished
« on: July 11, 2014, 09:39:09 PM »
I have expected the next version.
Thanks in advance :D

8
NGUI 3 Support / Re: SpringPosition of onFinished
« 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?

9
NGUI 3 Support / Re: UICenterOnChild of onDragFinished
« on: July 10, 2014, 10:56:06 PM »
I am sorry.
I'm using a machine translation.

Future onStoppedMoving do you add it?
It is meaning.

It can do, although he would like to do this by onStoppedMoving?

1. When operation is completed by UICenterOnChild.Recenter.(UICenterOnChild.onFinished)
2. When operation is completed by UIScrollView.Drag.(UIScrollView.onDragFinished)
3. When operation is completed by UIScrollBar.OnPressBackground and UIScrollBar.OnDragBackground.(UIProgressBar.onDragFinished)


10
NGUI 3 Support / Re: UICenterOnChild of onDragFinished
« on: July 09, 2014, 07:17:48 AM »
Do I hear that onStoppedMoving is mounted by future release?

There are three parts which want to detect an event.

1. When operation is completed by UICenterOnChild.Recenter.(UICenterOnChild.onFinished)
2. When operation is completed by UIScrollView.Drag.(UIScrollView.onDragFinished)
3. When operation is completed by UIScrollBar.OnPressBackground and UIScrollBar.OnDragBackground.(UIProgressBar.onDragFinished)

It will be saved if you take these into consideration.

11
NGUI 3 Support / Re: SpringPosition of onFinished
« on: July 09, 2014, 02:13:21 AM »
When SpringPosition exists, can it prevent from clearing onFinished?

12
You can also use filled sprite.

Thank you.
We were thinking that too, but change is difficult because it is in large amounts's incorporated in UISlider.

That seems fine to me, you_inoue. I will add it back in.

Thank you in advance :)

13
Hi!
I am using NGUI3.6.7.

It is not much of an exaggeration, but the title, Bar of Foreground is displayed UIProgress.value despite zero.
I'm used in HitPoint gauge, but I'm having problems gauge is not empty.
Version was forgotten, but they did not appear in earlier versions.

And are used by rewriting as follows code as the current deal.

  1. UIProgress.ForceUpdate(Line333)
  2. ----------------------------------------------------------------------
  3. [NGUI3.6.7]
  4. UIBasicSprite sprite = mFG as UIBasicSprite;
  5.  
  6. if (isHorizontal)
  7. ----------------------------------------------------------------------
  8. [Rewrite]
  9. UIBasicSprite sprite = mFG as UIBasicSprite;
  10.  
  11. if (this.value > 0.001f)
  12.         mFG.enabled = true;
  13. else
  14.         mFG.enabled = false;
  15.  
  16. if (isHorizontal)
  17. ----------------------------------------------------------------------
  18.  

This specification or will return to the original in the future?

14
NGUI 3 Support / SpringPosition of onFinished
« 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?

15
NGUI 3 Support / UICenterOnChild of onDragFinished
« on: July 08, 2014, 01:14:15 AM »
Hi!
I am using NGUI3.6.7.

Use the UICenterOnChild, I would like to issue an event that scroll is finished, but it's not working.
Is it possible to have them updated as follows.

  1. UICenterOnChild.OnEnable(Line54)
  2. ----------------------------------------------------------------------
  3. [NGUI3.6.7]
  4. if (mScrollView) mScrollView.onDragFinished = OnDragFinished;
  5. ----------------------------------------------------------------------
  6. [Change]
  7. if (mScrollView) mScrollView.onDragFinished += OnDragFinished;
  8. ----------------------------------------------------------------------
  9.  

  1. UICenterOnChild.Recenter(Line85)
  2. ----------------------------------------------------------------------
  3. [NGUI3.6.7]
  4. mScrollView.onDragFinished = OnDragFinished;
  5.  
  6. if (mScrollView.horizontalScrollBar != null)
  7.         mScrollView.horizontalScrollBar.onDragFinished = OnDragFinished;
  8.  
  9. if (mScrollView.verticalScrollBar != null)
  10.         mScrollView.verticalScrollBar.onDragFinished = OnDragFinished;
  11. ----------------------------------------------------------------------
  12. [Change]
  13. mScrollView.onDragFinished += OnDragFinished;
  14.  
  15. if (mScrollView.horizontalScrollBar != null)
  16.         mScrollView.horizontalScrollBar.onDragFinished += OnDragFinished;
  17.  
  18. if (mScrollView.verticalScrollBar != null)
  19.         mScrollView.verticalScrollBar.onDragFinished += OnDragFinished;
  20. ----------------------------------------------------------------------
  21.  

Pages: [1]