Example #1
0
        public void ShouldDoNothingWhenWeightsAreZero()
        {
            var blendGroup = new BlendGroup {
                FillBehavior = FillBehavior.Stop
            };
            var animation1 = new SingleFromToByAnimation {
                From = 0, To = 100, Duration = TimeSpan.FromSeconds(1.0)
            };
            var animation2 = new SingleFromToByAnimation {
                From = 100, To = 300, Duration = TimeSpan.FromSeconds(2.0)
            };

            blendGroup.Add(animation1);
            blendGroup.Add(animation2);
            blendGroup.SetWeight(0, 0);
            blendGroup.SetWeight(1, 0);

            Assert.That(() => blendGroup.SynchronizeDurations(), Throws.Nothing);
            blendGroup.Update();
            Assert.AreEqual(0.0f, blendGroup.GetNormalizedWeight(0));
            Assert.AreEqual(0.0f, blendGroup.GetNormalizedWeight(1));
        }
Example #2
0
        public void ShouldDoNothingWhenWeightsAreZero()
        {
            var blendGroup = new BlendGroup { FillBehavior = FillBehavior.Stop };
              var animation1 = new SingleFromToByAnimation { From = 0, To = 100, Duration = TimeSpan.FromSeconds(1.0) };
              var animation2 = new SingleFromToByAnimation { From = 100, To = 300, Duration = TimeSpan.FromSeconds(2.0) };
              blendGroup.Add(animation1);
              blendGroup.Add(animation2);
              blendGroup.SetWeight(0, 0);
              blendGroup.SetWeight(1, 0);

              Assert.That(() => blendGroup.SynchronizeDurations(), Throws.Nothing);
              blendGroup.Update();
              Assert.AreEqual(0.0f, blendGroup.GetNormalizedWeight(0));
              Assert.AreEqual(0.0f, blendGroup.GetNormalizedWeight(1));
        }