Exemple #1
0
    public IEnumerator SceneObjectFloorObject()
    {
        SceneObject sceneObject = BuilderInWorldUtils.CreateFloorSceneObject();

        LoadParcelScenesMessage.UnityParcelScene data = scene.sceneData;
        data.contents = new List <ContentServerUtils.MappingPair>();
        data.baseUrl  = BuilderInWorldSettings.BASE_URL_CATALOG;

        foreach (KeyValuePair <string, string> content in sceneObject.contents)
        {
            ContentServerUtils.MappingPair mappingPair = new ContentServerUtils.MappingPair();
            mappingPair.file = content.Key;
            mappingPair.hash = content.Value;
            bool found = false;
            foreach (ContentServerUtils.MappingPair mappingPairToCheck in data.contents)
            {
                if (mappingPairToCheck.file == mappingPair.file)
                {
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                data.contents.Add(mappingPair);
            }
        }

        Environment.i.world.sceneController.UpdateParcelScenesExecute(data);


        string entityId = "1";

        TestHelpers.CreateSceneEntity(scene, entityId);

        TestHelpers.CreateAndSetShape(scene, entityId, DCL.Models.CLASS_ID.GLTF_SHAPE, JsonConvert.SerializeObject(
                                          new
        {
            assetId = BuilderInWorldSettings.FLOOR_TEXTURE_VALUE,
            src     = BuilderInWorldSettings.FLOOR_MODEL
        }));;

        LoadWrapper gltfShape = GLTFShape.GetLoaderForEntity(scene.entities[entityId]);

        yield return(new WaitUntil(() => gltfShape.alreadyLoaded));

        Assert.IsTrue(
            scene.entities[entityId].gameObject.GetComponentInChildren <UnityGLTF.InstantiatedGLTFObject>() != null,
            "Floor should be loaded, is the SceneObject not working anymore?");
    }
Exemple #2
0
    public void CreateDefaultFloor()
    {
        CatalogItem floorSceneObject = BuilderInWorldUtils.CreateFloorSceneObject();

        CreateFloor(floorSceneObject);
    }
    public void SetupNewScene()
    {
        SceneObject floorSceneObject = BuilderInWorldUtils.CreateFloorSceneObject();

        CreateFloor(floorSceneObject);
    }