Ejemplo n.º 1
0
    IEnumerator PostRating()
    {
        yield return(LimChartZoneWebApi.PostRating(Data.Id, new Rating()
        {
            Rate = UserRating, UserId = SystemInfo.deviceUniqueIdentifier
        }));

        yield return(GetRating());
    }
Ejemplo n.º 2
0
    IEnumerator GetChartList()
    {
        #region Seed

        /*List<Lanotalium.ChartZone.ChartZoneChart> charts = JsonConvert.DeserializeObject<List<Lanotalium.ChartZone.ChartZoneChart>>(File.ReadAllText(@"H:\Server\html\lanotalium\chartzone\ChartList.json"));
         * foreach (var chart in charts)
         * {
         *  yield return LimChartZoneWebApi.AddChart(new LimChartZoneWebApi.ChartDto()
         *  {
         *      ChartName = chart.ChartName,
         *      Designer = chart.Designer,
         *      NoteCount = chart.NoteCount,
         *      Size = chart.Size,
         *      BilibiliAvIndex = chart.BilibiliAvIndex
         *  });
         * }
         * Dictionary<string, int> rat = JsonConvert.DeserializeObject<Dictionary<string, int>>(File.ReadAllText(@"H:\Server\html\lanotalium\chartzone\Modelista\Rating.json"));
         * foreach (string key in rat.Keys)
         * {
         *  LimChartZoneWebApi.Rating rating = new LimChartZoneWebApi.Rating
         *  {
         *      Rate = rat[key],
         *      UserId = key
         *  };
         *  yield return LimChartZoneWebApi.PostRating(14, rating);
         * }*/
        #endregion
        ObjectWrap <List <ChartDto> > Charts = new ObjectWrap <List <ChartDto> >();
        yield return(LimChartZoneWebApi.GetAllCharts(Charts));

        Charts.Reference.Reverse();

        int HeightCount = 0;
        foreach (ChartDto Chart in Charts.Reference)
        {
            GameObject tGO = Instantiate(ChartBarPrefab, ChartListContent);
            tGO.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, HeightCount);
            tGO.GetComponent <LimChartBarManager>().Initialize(Chart);
            _BarManagers.Add(tGO.GetComponent <LimChartBarManager>());
            HeightCount -= 50;
        }
        ChartListContent.sizeDelta = new Vector2(0, -HeightCount);
        _LoadChartListFinished     = true;
    }
Ejemplo n.º 3
0
    IEnumerator GetRating()
    {
        ObjectWrap <ChartDto> DataRef = new ObjectWrap <ChartDto>();

        yield return(LimChartZoneWebApi.GetChartById(Data.Id, DataRef));

        Data               = DataRef.Reference;
        OnlineRating       = (float)Data.AvgRating;
        RatingSlider.value = OnlineRating;
        UserRating         = Data.UsrRating;

        /*WWWForm Form = new WWWForm();
         * Form.AddField("ChartName", Data.ChartName);
         * WWW Rating = new WWW(LimSystem.LanotaliumServer + "/lanotalium/chartzone/ChartZoneGetRating.php", Form);
         * yield return Rating;
         * UnityEngine.Debug.Log(Rating.text);
         *
         * if (!isReceivingUserRating) RatingSlider.value = OnlineRating;
         * Form.AddField("UserId", SystemInfo.deviceUniqueIdentifier);
         * Rating = new WWW(LimSystem.LanotaliumServer + "/lanotalium/chartzone/ChartZoneGetRating.php", Form);
         * yield return Rating;
         * int.TryParse(Rating.text, out UserRating);*/
    }