コード例 #1
0
        private void ParseExhibition(string json)
        {
            if (json == null)
            {
                Debug.LogError("Couldn't load exhibition from backend");
                Debug.Log("Loading placeholder instead");
                var jtf = Resources.Load <TextAsset>("Configs/placeholder-exhibition");
                json = jtf.text;
            }

            Debug.Log(json);
            var ex = JsonUtility.FromJson <Exhibition>(json);

            Debug.Log(json);
            Debug.Log(ex);
            Debug.Log(_buildingManager);
            // TODO create lobby

            _exhibitionManager = new ExhibitionManager(ex);
            _exhibitionManager.GenerateExhibition();
            //_buildingManager.Create(ex);


            //_buildingManager.BuildRoom(ex.rooms[0]);

/*
 *    if (Settings.PlaygroundEnabled)
 *    {*/
            /*
             * ex.rooms[0].position = new Vector3(15,0,0);
             * ObjectFactory.BuildRoom(ex.rooms[0]);
             */
            //    }
        }
コード例 #2
0
    public void activateRoomTrigger(ExhibitionManager manager)
    {
        var room = manager.GetRoomByIndex(0);

        if (room != null)
        {
            text.OnTeleportEnd = room.OnRoomEnter;
            next.OnTeleportEnd = room.OnRoomEnter;
            wall.OnTeleportEnd = room.OnRoomEnter;
        }
    }
コード例 #3
0
        private void ParseExhibition(string json)
        {
            if (json == null)
            {
                Debug.LogError("Couldn't load exhibition from backend");
                Debug.Log("Loading placeholder instead");
                var jtf = Resources.Load <TextAsset>("Configs/placeholder-exhibition");
                json = jtf.text;
            }

            Debug.Log(json);
            Exhibition ex = JsonUtility.FromJson <Exhibition>(json);

            Debug.Log(json);
            Debug.Log(ex);
            Debug.Log(_buildingManager);
            // TODO create lobby

            _exhibitionManager = new ExhibitionManager(ex);
            _exhibitionManager.GenerateExhibition();
            if (VREPController.Instance.Settings.StartInLobby)
            {
                GameObject.Find("Lobby").GetComponent <Lobby>().activateRoomTrigger(_exhibitionManager);
            }
            else
            {
                GameObject.Find("Room").gameObject.transform.Find("Timer").transform.GetComponent <MeshRenderer>().enabled = true;
            }

            //_buildingManager.Create(ex);


            //_buildingManager.BuildRoom(ex.rooms[0]);

/*
 *    if (Settings.PlaygroundEnabled)
 *    {*/
            /*
             * ex.rooms[0].position = new Vector3(15,0,0);
             * ObjectFactory.BuildRoom(ex.rooms[0]);
             */
            //    }
        }
コード例 #4
0
    private void createExhibition(int numb)
    {
        // get the random Images from Cineast uses int parameter for number of images
        Exhibit[] arr        = getExhibits(numb, randomIds);
        Exhibit[] exarrEmpty = new Exhibit[0];
        Exhibit[] Canvas     = createMyCanvas(randomIds);


        //Create four Walls

        DefaultNamespace.VREM.Model.Wall wallone = new DefaultNamespace.VREM.Model.Wall
        {
            color = new Vector3(0.7f, 0.7f, 0.7f), texture = "Fabric02Material", direction = "NORTH", exhibits = arr
        };

        DefaultNamespace.VREM.Model.Wall walltwo = new DefaultNamespace.VREM.Model.Wall
        {
            color    = new Vector3(0.7f, 0.7f, 0.7f), texture = "Fabric02Material", direction = "EAST",
            exhibits = Canvas
        };
        DefaultNamespace.VREM.Model.Wall wallthree = new DefaultNamespace.VREM.Model.Wall
        {
            color    = new Vector3(0.7f, 0.7f, 0.7f), texture = "Fabric02Material", direction = "SOUTH",
            exhibits = exarrEmpty
        };
        DefaultNamespace.VREM.Model.Wall wallfour = new DefaultNamespace.VREM.Model.Wall
        {
            color    = new Vector3(0.7f, 0.7f, 0.7f), texture = "Fabric02Material", direction = "WEST",
            exhibits = exarrEmpty
        };


        // Create room wth these four walls

        DefaultNamespace.VREM.Model.Wall[] wallar      = { wallone, walltwo, wallthree, wallfour };
        DefaultNamespace.VREM.Model.Room   myFirstRoom = new DefaultNamespace.VREM.Model.Room
        {
            walls      = wallar,
            size       = new Vector3(8, 3, 10),
            floor      = "NWoodFloor",
            ceiling    = "Fabric02Material",
            text       = "TExtofRoom",
            position   = new Vector3(0, 0, 0),
            entrypoint = new Vector3(0.7f, 0.7f, 0.7f)
        };


        DefaultNamespace.VREM.Model.Room[] myroomArr = { myFirstRoom };


        // create an Exhibition with the created room

        Exhibition ex = new Exhibition
        {
            id = "myid1", name = "myExhibition1", description = "myNoDesc", rooms = myroomArr
        };


        myEx = new Exhibition();
        myEx = ex;
        myexhibitionManager = new ExhibitionManager(ex);
        myexhibitionManager.GenerateExhibition();


        //collision();
        ;
    }