예제 #1
0
        public void ExportGameObjects_SceneClosedAfterExport()
        {
            var filePath = CreateTmpUsdFile("dummyUsd.usda");
            var scene    = Scene.Open(filePath);

            ExportHelpers.ExportGameObjects(new [] { new GameObject("test") }, scene, BasisTransformation.SlowAndSafe);
            Assert.IsNull(scene.Stage);
        }
예제 #2
0
        public void ExportGameObjects_InvalidGO()
        {
            var filePath = CreateTmpUsdFile("dummyUsd.usda");
            var scene    = Scene.Open(filePath);

            Assert.DoesNotThrow(delegate()
            {
                ExportHelpers.ExportGameObjects(new GameObject[] { null }, scene, BasisTransformation.SlowAndSafe);
            });
            UnityEngine.TestTools.LogAssert.Expect(LogType.Exception, "NullReferenceException: Object reference not set to an instance of an object");
        }
예제 #3
0
        public void ExportGameObjects_ValidGO()
        {
            var filePath = CreateTmpUsdFile("dummyUsd.usda");
            var scene    = Scene.Open(filePath);

            ExportHelpers.ExportGameObjects(new [] { new GameObject("test") }, scene, BasisTransformation.SlowAndSafe);
            scene = Scene.Open(filePath);
            var paths = scene.Stage.GetAllPaths();

            Debug.Log(scene.Stage.GetRootLayer().ExportToString());
            Assert.AreEqual(2, paths.Count);
            scene.Close();
        }
예제 #4
0
        public void ExportGameObjects_EmptyList()
        {
            var filePath       = CreateTmpUsdFile("dummyUsd.usda");
            var scene          = Scene.Open(filePath);
            var fileInfoBefore = new FileInfo(filePath);

            Assert.DoesNotThrow(delegate()
            {
                ExportHelpers.ExportGameObjects(new GameObject [] {}, scene, BasisTransformation.SlowAndSafe);
            });
            var fileInfoAfter = new FileInfo(filePath);

            Assert.AreEqual(fileInfoBefore.Length, fileInfoAfter.Length);
            scene.Close();
        }