Esempio n. 1
0
        void ViewBind(CommonPickUpView view)
        {
            BindingSet <CommonPickUpView, CommonPickUpViewModel> bindingSet =
                view.CreateBindingSet <CommonPickUpView, CommonPickUpViewModel>();

            bindingSet.Bind(view.Show).For(v => v.activeSelf).To(vm => vm.Show).OneWay();
            bindingSet.Bind(view.ItemName).For(v => v.text).To(vm => vm.ItemName).OneWay();

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

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

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonPickUpView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Esempio n. 3
0
 void SaveOriData(CommonPickUpView view)
 {
     view.oriShow     = _show;
     view.oriItemName = _itemName;
 }
Esempio n. 4
0
 void DataInit(CommonPickUpView view)
 {
     _show     = view.Show.activeSelf;
     _itemName = view.ItemName.text;
 }
Esempio n. 5
0
 private void EventTriggerBind(CommonPickUpView view)
 {
 }