Beispiel #1
0
    public void UpdateRecordPie(RepeatedField <CareerWinLoseDataItem> winlost)
    {
        Common.CareerWins.Clear();

        for (int i = 0; i < winlost.Count; i++)
        {
            uint Win  = winlost [i].Win;
            uint Lose = winlost [i].Lose;

            if (winlost [i].Win == 0 && winlost [i].Lose == 0)
            {
                Win = 50; Lose = 50;
            }

            double winper  = Convert.ToDouble(Win) / Convert.ToDouble(Win + Lose);
            double loseper = Convert.ToDouble(Lose) / Convert.ToDouble(Win + Lose);

            int WinPro  = Convert.ToInt32(Math.Round((decimal)winper, 2, MidpointRounding.AwayFromZero) * 100);
            int LosePro = Convert.ToInt32(Math.Round((decimal)loseper, 2, MidpointRounding.AwayFromZero) * 100);

            int Wintemp  = (int)Win;
            int Losetemp = -(int)Lose;
            Common.CareerWins.Add(Wintemp + Losetemp);
            if (winlost [i].Win == 0 && winlost [i].Lose == 0)
            {
                UpdateRecordData(i, WinPro, LosePro, 0, 0);
            }
            else
            {
                UpdateRecordData(i, WinPro, LosePro, Win, Lose);
            }
        }

        PageView.pageTo(0);
    }
 public void onClick()
 {
     try {
         int idnex = int.Parse(inputField.text);
         pageView.pageTo(idnex);
     } catch (Exception ex) {
         Debug.LogWarning("请输入数字" + ex.ToString());
     }
 }
    public void OnButtonDown()
    {
        int index = int.Parse(inputField.text);

        pageView.pageTo(index);
    }