Ejemplo n.º 1
0
        void ViewBind(CommonHurtedView view)
        {
            BindingSet <CommonHurtedView, CommonHurtedViewModel> bindingSet =
                view.CreateBindingSet <CommonHurtedView, CommonHurtedViewModel>();

            bindingSet.Bind(view.hurtedRootActive).For(v => v.activeSelf).To(vm => vm.hurtedRootActive).OneWay();

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

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

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonHurtedView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Ejemplo n.º 3
0
 void SaveOriData(CommonHurtedView view)
 {
     view.orihurtedRootActive = _hurtedRootActive;
 }
Ejemplo n.º 4
0
 void DataInit(CommonHurtedView view)
 {
     _hurtedRootActive = view.hurtedRootActive.activeSelf;
 }
Ejemplo n.º 5
0
 private void EventTriggerBind(CommonHurtedView view)
 {
 }