예제 #1
0
    private void addEvents()
    {
        oddsRatio.Subscribe((odd) => {
            Odds.text       = oddsRatio.Value.ToString();
            Compensate.text = CompensateValue.ToString();
            BreakEventButton.transform.Find("Text").GetComponent <Text>().text = beValue.ToString();
            EqualButton.transform.Find("Text").GetComponent <Text>().text      = eqValue.ToString();
            AdjustCASliderSetting();
            adjustCalcText();
        }).AddTo(this);

        //加时
        RxSubjects.Moretime.Subscribe((e) => {
            var model = e.Data.ToObject <MoreTimeModel>();

            if (model.IsRound())
            {
                return;
            }

            StopCoroutine(myCoroutine);
            myCoroutine = Timer(model.total);
            StartCoroutine(myCoroutine);
        }).AddTo(this);

        //中途进入房间逻辑
        RxSubjects.Look.Subscribe((e) => {
            GetComponent <DOPopup>().Close();
        }).AddTo(this);

        //直接退出不购买保险
        ExitButton.OnClickAsObservable().Subscribe((_) => {
            if (isBuyer)
            {
                Connect.Shared.Emit(new Dictionary <string, object>()
                {
                    { "f", "noinsurance" },
                });
            }
            GetComponent <DOPopup>().Close();
        }).AddTo(this);

        RxSubjects.RsyncInsurance.Subscribe((e) => {
            if (e.Data.Int("closeflag") == 1)
            {
                Exit();
                return;
            }

            savedSliderValue = e.Data.Int("CASlidernum");

            if (e.Data.Int("selectedChange") == 0)
            {
                CASlider.value = savedSliderValue;
            }
        }).AddTo(this);
    }
예제 #2
0
 private void adjustCalcText()
 {
     SumInsured.text   = CASlider.value.ToString();
     Compensate.text   = CompensateValue.ToString();
     BuyButtonNum.text = CASlider.value.ToString();
 }