Exemplo n.º 1
0
        public void Blend_AfterBlend_NonInstant_State_IsPlaying([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type)
        {
            IAnimation animation     = ComparativeTestFixture.Instantiate(type);
            var        clipX         = Resources.Load <AnimationClip>("LinearX");
            var        clipInstanceX = Object.Instantiate <AnimationClip>(clipX);

            clipInstanceX.legacy = animation.usesLegacy;

            animation.AddClip(clipInstanceX, "ToBlend");
            animation.Blend("ToBlend", 1, 0.5f);

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

            clipInstanceX.legacy = animation.usesLegacy;

            animation.AddClip(clipInstanceX, "ToBlend");
            animation.Blend("ToBlend", 0, 0);
            yield return(null);

            Assert.IsTrue(animation.IsPlaying("ToBlend"));
        }
Exemplo n.º 3
0
        public void Blend_DoesntChange_OtherState_Weight([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type)
        {
            IAnimation animation     = ComparativeTestFixture.Instantiate(type);
            var        clipX         = Resources.Load <AnimationClip>("LinearX");
            var        clipInstance1 = Object.Instantiate <AnimationClip>(clipX);
            var        clipInstance2 = Object.Instantiate <AnimationClip>(clipX);

            clipInstance1.legacy = animation.usesLegacy;
            clipInstance2.legacy = animation.usesLegacy;

            animation.AddClip(clipInstance1, "ToBlend");
            animation.AddClip(clipInstance2, "ToLeaveAlone");
            animation.Play("ToLeaveAlone");
            animation.Blend("ToBlend", 1f, 0f);

            Assert.AreEqual(1f, animation.GetState("ToLeaveAlone").weight);
        }