Exemplo n.º 1
0
        void ViewBind(BlastC4TipView view)
        {
            BindingSet <BlastC4TipView, BlastC4TipViewModel> bindingSet =
                view.CreateBindingSet <BlastC4TipView, BlastC4TipViewModel>();

            bindingSet.Bind(view.C4TipValue).For(v => v.fillAmount).To(vm => vm.C4TipValue).OneWay();

            bindingSet.Build();
        }
Exemplo n.º 2
0
        public void CreateBinding(GameObject obj)
        {
            _viewGameObject = obj;
            _viewCanvas     = _viewGameObject.GetComponent <Canvas>();

            bool bFirst = false;
            var  view   = obj.GetComponent <BlastC4TipView>();

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <BlastC4TipView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Exemplo n.º 3
0
 void SaveOriData(BlastC4TipView view)
 {
     view.oriC4TipValue = _c4TipValue;
 }
Exemplo n.º 4
0
 void DataInit(BlastC4TipView view)
 {
     _c4TipValue = view.C4TipValue.fillAmount;
 }
Exemplo n.º 5
0
 private void EventTriggerBind(BlastC4TipView view)
 {
 }