void ViewBind(CommonGameOverView view) { BindingSet <CommonGameOverView, CommonGameOverViewModel> bindingSet = view.CreateBindingSet <CommonGameOverView, CommonGameOverViewModel>(); bindingSet.Bind(view.Show).For(v => v.activeSelf).To(vm => vm.Show).OneWay(); bindingSet.Bind(view.ContinueBtnClick).For(v => v.onClick).To(vm => vm.ContinueBtnClick).OneWay(); bindingSet.Bind(view.ContinueBtnShow).For(v => v.activeSelf).To(vm => vm.ContinueBtnShow).OneWay(); bindingSet.Build(); }
public void CreateBinding(GameObject obj) { _viewGameObject = obj; _viewCanvas = _viewGameObject.GetComponent <Canvas>(); bool bFirst = false; var view = obj.GetComponent <CommonGameOverView>(); if (view == null) { bFirst = true; view = obj.AddComponent <CommonGameOverView>(); view.FillField(); } DataInit(view); SpriteReset(); view.BindingContext().DataContext = this; if (bFirst) { SaveOriData(view); ViewBind(view); } _view = view; }
void SaveOriData(CommonGameOverView view) { view.oriShow = _show; view.oriContinueBtnShow = _continueBtnShow; }
void DataInit(CommonGameOverView view) { _show = view.Show.activeSelf; _continueBtnShow = view.ContinueBtnShow.activeSelf; }
private void EventTriggerBind(CommonGameOverView view) { }