예제 #1
0
        public IEnumerator TestLoadModel()
        {
            bool loaded = false;

            bool waiting = true;

            rest.LoadModel(geoModelUrn: testModelName)
            .Then(() =>
            {
                loaded = true;

                waiting = false;
            })
            .Catch(error =>
            {
                Debug.Log(error.Message);

                waiting = false;

                throw error;
            });

            while (waiting)
            {
                yield return(null);
            }

            Assert.IsTrue(loaded);
        }
예제 #2
0
        public IEnumerator TestSpawnModelOutput()
        {
            bool waiting = true;

            int expectedSpawnedMeshesCount = 6;

            var container = new Core.Data.GemPy.GameObjectContainers.Output();

            rest.LoadModel(geoModelUrn: testModelName)
            .Then(() =>
            {
                return(rest.GetModelOutput(geoModelUrn: testModelName));
            })
            .Then(modelOutput =>
            {
                return(spawning.SpawnModelOutput(
                           outputData: modelOutput,
                           outputContainer: container));
            })
            .Then(() =>
            {
                waiting = false;
            })
            .Catch(error =>
            {
                Debug.Log(error.Message);

                waiting = false;
            });

            while (waiting)
            {
                yield return(null);
            }

            int meshRendererCount = container.RexMeshesGameObject.GetComponentsInChildren <MeshRenderer>().Length;

            Debug.Log("Spawned " + meshRendererCount + " game objects with mesh renderers.");

            Assert.AreEqual(expectedSpawnedMeshesCount, meshRendererCount);
        }