예제 #1
0
    void ApplySettings()
    {
        bool isMinPass = int.TryParse(minInp.text, out int min);
        bool isMaxPass = int.TryParse(maxInp.text, out int max);

        if (!isMinPass)
        {
            min = 1;
        }
        if (!isMaxPass)
        {
            max = 100;
        }
        if (min > max)
        {
            var tmp = min;
            min = max;
            max = tmp;
        }
        minInp.text = min.ToString();
        maxInp.text = max.ToString();

        bool isResultCountInpPass = int.TryParse(resultCountInp.text, out int resultCount);

        if (!isResultCountInpPass)
        {
            resultCount = 1;
        }
        resultCount         = Mathf.Clamp(resultCount, 1, 5);
        resultCountInp.text = resultCount.ToString();

        LotteryAlgorithm.SetUp(min, max, resultCount, allowRepeatTG.isOn);
    }
예제 #2
0
 // BtnEvnt
 public void OnDraw()
 {
     lottery.StartAnimation(() =>
     {
         var result = LotteryAlgorithm.Draw();
         RefreshTextsAtNav(result);
         RefreshTextsAtFloor(result);
     });
 }
예제 #3
0
 // BtnEvnt
 public void OnResetLottery()
 {
     LotteryAlgorithm.Reset();
     textsAtNav.ForEach(x => x.text          = string.Empty);
     lottery.txtsOnFloor.ForEach(x => x.text = string.Empty);
 }