Ejemplo n.º 1
0
        /// <summary>
        /// Loads the ambient audio of this room.
        /// As soon as the audio is loaded, it will be played.
        /// </summary>
        public void LoadAmbientAudio()
        {
            if (string.IsNullOrEmpty(RoomData.Ambient))
            {
                return;
            }
            Debug.Log("Add audio to room.");

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

            _audioLoader.ReloadAudio(RoomData.Ambient);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Loads the ambient audio of this room.
        ///     As soon as the audio is loaded, it will be played.
        /// </summary>
        public void LoadAmbientAudio()
        {
            if (!string.IsNullOrEmpty(RoomData.GetURLEncodedAudioPath()))
            {
                Debug.Log("add audio to room");


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

                _audioLoader.ReloadAudio(RoomData.GetURLEncodedAudioPath());
            }
        }
Ejemplo n.º 3
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));
    }