Exemplo n.º 1
0
        public GetLevelsResponse GetLevels(GetLevelsRequest request)
        {
            var levels   = DataContext.Levels.ToList();
            var response = new GetLevelsResponse();

            response.Levels = levels.MapTo <GetLevelsResponse.Level>();
            //response.Levels = levels.MapTo<GetLevelResponse>();

            return(response);
        }
Exemplo n.º 2
0
    public IEnumerator GetLevels(Action <GetLevelsResponse> succes)
    {
        WWW www = new WWW(url + levelsurl);

        yield return(www);

        GetLevelsResponse glr = GetLevelsResponse.FromJson(www.text);

        Debug.Log(www.text);

        succes.Invoke(glr);
    }
Exemplo n.º 3
0
    public void LevelDownloadDone(GetLevelsResponse glr)
    {
        if (glr.succes)
        {
            Debug.Log("Succesfuly downloaded new levels");
            _downloadLevelsPanel.DoneDownloading();

            Levelhash lh = Levelhash.All().First();
            lh.hash = _newlevelsHash;
            lh.Save();

            SaveLevels(glr.data);
            _levelController.ReloadLevels();
        }
        else
        {
            Debug.Log("Failed to download new levels");
        }
    }