void Awake() { modal = ModalHelper.Create(); modal.Show(G.DialogCvs.transform, null, new Color(0, 0, 0, 153 / 255f)); RxSubjects.GameReset.Subscribe((_) => { Destroy(gameObject); }).AddTo(this); }
private void showModalIfNeeded() { if (modal) { modalHelper = ModalHelper.Create(); modalHelper.Show(transform.parent, () => { if (onClickModal != null) { onClickModal(); } if (closeOnClick) { Close(); } }, modalColor); transform.SetAsLastSibling(); } }
public void OnRaiseClick() { slidDisposables.Clear(); slidParent.SetActive(true); Slid.maxValue = range[1]; Slid.value = Slid.minValue = range[0]; Slid.wholeNumbers = true; MaxText.text = _.Num2CnDigit(range[1]); // 未按下时,隐藏加注提示 RoundTipsGo.SetActive(false); AccurateBtn.SetActive(false); var pointerDown = false; Slid.OnValueChangedAsObservable().Subscribe((value) => { if (value >= range[1] && canAllin) { Allin.SetActive(true); RoundTipsGo.SetActive(false); } else { Allin.SetActive(false); if (pointerDown) { RoundTipsGo.SetActive(true); } } RaiseNumber.text = _.Num2CnDigit(value); TipsText.text = _.Num2CnDigit(value); }).AddTo(slidDisposables); Slid.OnPointerDownAsObservable().Subscribe((pointerEvt) => { var rect = Slid.GetComponent <RectTransform>(); changeTipsPosition(rect, pointerEvt.position, pointerEvt.pressEventCamera); pointerDown = true; RoundTipsGo.SetActive(true); }).AddTo(slidDisposables); Slid.OnDragAsObservable().Subscribe((dragEvt) => { var rect = Slid.GetComponent <RectTransform>(); changeTipsPosition(rect, dragEvt.position, dragEvt.pressEventCamera); }).AddTo(slidDisposables); Slid.OnPointerUpAsObservable().Subscribe((_) => { pointerDown = false; RoundTipsGo.SetActive(false); }).AddTo(slidDisposables); // 展示遮罩 modal = ModalHelper.Create(); modal.Show(transform.parent, hideRaiseSlider); transform.SetAsLastSibling(); setToggle(false); }