Exemplo n.º 1
0
        public void CrossfadeQueue_WithNoClipAttached_FailsOnCall([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type)
        {
            IAnimation animation = ComparativeTestFixture.Instantiate(type);

            LogAssert.Expect(LogType.Error, new Regex(""));
            animation.CrossFadeQueued("UnknownState", 0f, QueueMode.CompleteOthers);
        }
Exemplo n.º 2
0
        public IEnumerator CrossfadeQueue_WithInvalidName_FailsOnCall([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type)
        {
            IAnimation animation    = ComparativeTestFixture.Instantiate(type);
            var        clip         = Resources.Load <AnimationClip>("LinearX");
            var        clipInstance = Object.Instantiate <AnimationClip>(clip);

            clipInstance.legacy = animation.usesLegacy;

            animation.AddClip(clipInstance, "ToPlay");
            LogAssert.Expect(LogType.Error, new Regex(""));
            animation.CrossFadeQueued("invalidName", 0f, QueueMode.CompleteOthers);

            yield return(null);
        }
Exemplo n.º 3
0
        public IEnumerator CrossfadeQueue_WithNoClipPlaying_IsStatePlaying_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type)
        {
            IAnimation animation    = ComparativeTestFixture.Instantiate(type);
            var        clip         = Resources.Load <AnimationClip>("LinearX");
            var        clipInstance = Object.Instantiate <AnimationClip>(clip);

            clipInstance.legacy = animation.usesLegacy;

            animation.AddClip(clipInstance, "ToPlay");
            animation.CrossFadeQueued("ToPlay", 0f, QueueMode.CompleteOthers);

            yield return(null);

            Assert.IsTrue(animation.IsPlaying("ToPlay"));
        }
Exemplo n.º 4
0
        public IEnumerator CrossfadeQueue_WithClipPlaying_IsStatePlaying_AfterOriginalClipDone_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type)
        {
            IAnimation animation     = ComparativeTestFixture.Instantiate(type);
            var        clipX         = Resources.Load <AnimationClip>("LinearX");
            var        clipY         = Resources.Load <AnimationClip>("LinearY");
            var        clipInstanceX = Object.Instantiate <AnimationClip>(clipX);
            var        clipInstanceY = Object.Instantiate <AnimationClip>(clipY);

            clipInstanceX.legacy = animation.usesLegacy;
            clipInstanceY.legacy = animation.usesLegacy;

            animation.AddClip(clipInstanceY, "ToPlay");
            animation.AddClip(clipInstanceX, "ToCrossfade");
            animation.Play("ToPlay");
            animation.CrossFadeQueued("ToCrossfade", 0.0f, QueueMode.CompleteOthers);
            yield return(new WaitForSeconds(1.1f));

            Assert.IsTrue(animation.IsPlaying("ToCrossfade"));
        }