Esempio n. 1
0
        public void Test_AddKeyframe_ValueType()
        {
            var track = new AnimationTrack ("PropetyName", InterpolationType.Step);

            track.AddKeyframe (1, new Vector3 (1, 2, 3));
            track.AddKeyframe (2, new Vector3 (4, 5, 6));
            track.AddKeyframe (3, new Vector3 (7, 8, 9));
            track.AddKeyframe (4, new Vector3 (10, 11, 12));

            Assert.AreEqual (1, track.GetKeyframe (0).Time);
            Assert.AreEqual (new Vector3(1,2,3), track.GetKeyframe (0).Value);

            Assert.AreEqual (2, track.GetKeyframe (1).Time);
            Assert.AreEqual (new Vector3 (4,5,6), track.GetKeyframe (1).Value);

            Assert.AreEqual (3, track.GetKeyframe (2).Time);
            Assert.AreEqual (new Vector3 (7,8,9), track.GetKeyframe (2).Value);

            Assert.AreEqual (4, track.GetKeyframe (3).Time);
            Assert.AreEqual (new Vector3 (10,11,12), track.GetKeyframe (3).Value);
        }
Esempio n. 2
0
        public void Test_AddKeyframe_Primitive()
        {
            var track = new AnimationTrack ("PropetyName", InterpolationType.Step);

            // 内部でソート
            track.AddKeyframe (4, 4);
            track.AddKeyframe (3, 3);
            track.AddKeyframe (2, 2);
            track.AddKeyframe (1, 1);

            Assert.AreEqual (1, track.GetKeyframe (0).Time);
            Assert.AreEqual (1, track.GetKeyframe (0).Value);

            Assert.AreEqual (2, track.GetKeyframe (1).Time);
            Assert.AreEqual (2, track.GetKeyframe (1).Value);

            Assert.AreEqual (3, track.GetKeyframe (2).Value);
            Assert.AreEqual (3, track.GetKeyframe (2).Time);

            Assert.AreEqual (4, track.GetKeyframe (3).Value);
            Assert.AreEqual (4, track.GetKeyframe (3).Time);
        }