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

            bindingSet.Bind(view.rootLocation).For(v => v.anchoredPosition).To(vm => vm.rootLocation).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 <CommonLocationView>();

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonLocationView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Ejemplo n.º 3
0
 void SaveOriData(CommonLocationView view)
 {
     view.orirootLocation = _rootLocation;
 }
Ejemplo n.º 4
0
 void DataInit(CommonLocationView view)
 {
     _rootLocation = view.rootLocation.anchoredPosition;
 }
Ejemplo n.º 5
0
 private void EventTriggerBind(CommonLocationView view)
 {
 }