Beispiel #1
0
        public int TestConstraintAnimation(System.Type componentType, float[] keyTimes, float[] keyValues, string propertyName)
        {
            var go     = new GameObject("root");
            var source = new GameObject("source");

            source.transform.parent = go.transform;

            var constraint = go.AddComponent(componentType) as IConstraint;

            Assert.That(constraint, Is.Not.Null);

            var cSource = new ConstraintSource();

            cSource.sourceTransform = source.transform;

            int index = constraint.AddSource(cSource);

            Assert.That(index, Is.EqualTo(0));

            var keyData = new FbxAnimationTest.PropertyKeyData
            {
                targetObject   = go,
                componentType  = componentType,
                propertyName   = propertyName,
                keyTimes       = keyTimes,
                keyFloatValues = keyValues
            };
            var tester = new FbxAnimationTest.AnimTester {
                keyData = keyData, testName = "ConstraintAnim_" + propertyName, path = GetRandomFbxFilePath()
            };

            return(tester.DoIt());
        }
Beispiel #2
0
        public void AnimationWithCameraFOVTest()
        {
            var keyData = new FbxAnimationTest.PropertyKeyData
            {
                componentType  = typeof(Camera),
                propertyName   = "field of view",
                keyTimes       = new float[] { 0f, 1f, 2f },
                keyFloatValues = new float[] { 1f, 2f, 3f }
            };
            var tester = new FbxAnimationTest.AnimTester {
                keyData = keyData, testName = "CameraFOV", path = GetRandomFbxFilePath()
            };

            tester.DoIt();
        }
Beispiel #3
0
        public int AnimationWithLightTest(float[] keyTimes, float[] keyValues, string propertyName)
        {
            var keyData = new FbxAnimationTest.PropertyKeyData
            {
                componentType  = typeof(Light),
                propertyName   = propertyName,
                keyTimes       = keyTimes,
                keyFloatValues = keyValues
            };
            var tester = new FbxAnimationTest.AnimTester {
                keyData = keyData, testName = "LightAnim_" + propertyName, path = GetRandomFbxFilePath()
            };

            return(tester.DoIt());
        }