예제 #1
0
    private void PopulateWalls(DefaultNamespace.VREM.Model.Wall[] walls)
    {
        foreach (var wall in walls)
        {
            if (wall.direction == "NORTH")
            {
                LoadExhibits(wall, WallOrientation.NORTH);
                GetWallForOrientation(WallOrientation.NORTH).LoadMaterial(TexturingUtility.Translate(wall.texture));
            }

            if (wall.direction == "EAST")
            {
                LoadExhibits(wall, WallOrientation.EAST);
                GetWallForOrientation(WallOrientation.EAST).LoadMaterial(TexturingUtility.Translate(wall.texture));
            }

            if (wall.direction == "SOUTH")
            {
                LoadExhibits(wall, WallOrientation.SOUTH);
                GetWallForOrientation(WallOrientation.SOUTH).LoadMaterial(TexturingUtility.Translate(wall.texture));
            }

            if (wall.direction == "WEST")
            {
                LoadExhibits(wall, WallOrientation.WEST);
                GetWallForOrientation(WallOrientation.WEST).LoadMaterial(TexturingUtility.Translate(wall.texture));
            }
        }
    }
예제 #2
0
    public void Populate(DefaultNamespace.VREM.Model.Room room)
    {
        Debug.Log(room);
        Debug.Log(room.walls);
        _roomModel = room;


        Debug.Log("adjusting ceiling and floor");
        // TODO Use new material loading code
        gameObject.transform.Find("Ceiling").gameObject.GetComponent <TexturedMonoBehaviour>()
        .LoadMaterial(TexturingUtility.Translate(room.ceiling));
        gameObject.transform.Find("Floor").gameObject.GetComponent <TexturedMonoBehaviour>()
        .LoadMaterial(TexturingUtility.Translate(room.floor));

        /*Debug.Log("add globe");
         * if(GlobePrefab != null){ //TODO: add a new check
         *  var globe = Instantiate(GlobePrefab) as GameObject;
         *  globe.transform.rotation = Quaternion.Euler(-90, -90, 0);
         *  globe.transform.position = new Vector3(-2.5f, 0, -2.5f);
         *  globe.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
         * }*/

        if (!string.IsNullOrEmpty(room.GetURLEncodedAudioPath()))
        {
            Debug.Log("add audio to room");

            if (audio == null)
            {
                audio = gameObject.AddComponent <AudioLoader>();
            }

            audio.ReloadAudio(room.GetURLEncodedAudioPath());
        }
        //

        PopulateWalls(room.walls);
        //PlaceExhibits(room.exhibits);


        // DEBUG TESTING TODO REMOVE this when done
        //Debug.Log("Test");
        //LoadAndPlaceModel(ServerSettings.SERVER_ID+"content/get/5bd3292c64aa33a460bcdade%2f1%2fexhibits%2fearth.obj", new Vector3(0,1,0));
    }