Ejemplo n.º 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);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }