Notify() 공개 메소드

Fire all the progress callbacks with the current progress
public Notify ( float progress ) : void
progress float A floating point value representing the current progress
리턴 void
예제 #1
0
        public void TaskDoesNotify()
        {
            float value = 0f;
            float targetValue = 1f;

            UnityTask t = new UnityTask();
            t.Then(null, null, (p) => value = p);

            t.Notify(1f);

            Assert.That(Utils.Math.NearlyEqual(value, targetValue));
        }
예제 #2
0
        public void TaskDoesEndOnResolveAndReject()
        {
            bool value = false;
            bool targetValue = true;

            UnityTask t = new UnityTask();
            t.Then(onEnd: () => value = targetValue);

            t.Resolve(null);

            Assert.AreEqual(value, targetValue);

            value = false;

            t = new UnityTask();
            t.Then(onEnd: () => value = targetValue);

            t.Reject(null);

            Assert.AreEqual(value, targetValue);

            value = false;

            t = new UnityTask();
            t.Then(onEnd: () => value = targetValue);

            t.Notify(0f);

            Assert.AreNotEqual(value, targetValue);
        }