Exemplo n.º 1
0
    public IEnumerator processSceneList()
    {
        WWW www = new WWW("http://" + m_serverIP + ":" + m_serverPort + "/scenes/");

        yield return(www);

        if (string.IsNullOrEmpty(www.error))
        {
            Debug.Log(www.text);
            SceneInfoList      sceneList     = SceneInfoList.CreateFromJSON(www.text);
            LocalPlayerOptions playerOptions = LocalPlayerOptions.singleton;

            sceneList.scenes.ForEach(x => {
                playerOptions.AddServerScene(x.title, x.name);
            });
        }
        else
        {
            Debug.LogAssertion("Failed to get scene list from http://" + m_serverIP + ":" + m_serverPort + "/scenes/");
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        singleton = this;

        // First populate from PlayerPrefs if they exist
        populateUI();
        m_sceneFiles = new List <SceneFile>();
        m_sceneFiles.Add(new SceneFile("NewScene", "New Scene", false));
        List <string> t = new List <string> ();

        t.Add("New Scene");
        preloadFiles.GetComponent <Dropdown> ().AddOptions(t);
        Webserver.singleton.getSceneList();

        /*
         * List<Dropdown.OptionData> menuOptions = preloadFiles.GetComponent<Dropdown> ().options;
         *
         * menuOptions.ForEach (x => {
         *      m_sceneFiles.Add(new SceneFile(x.text, x.text, false));
         * });
         */
    }