Пример #1
0
        public void CreateBinding(GameObject obj)
        {
            _viewGameObject = obj;
            _viewCanvas     = _viewGameObject.GetComponent <Canvas>();

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

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonMaxMapView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;

            view.GenerateTrigger();
            EventTriggerBind(view);
        }
Пример #2
0
 private void EventTriggerBind(CommonMaxMapView view)
 {
     _onOnmaskBgETHoverChanged     = (val) => view.OnmaskBgETHover = val;
     _onOnmaskBgETClickChanged     = (val) => view.OnmaskBgETClick = val;
     _onOnmaskBgETMouseDownChanged = (val) => view.OnmaskBgETMouseDown = val;
     _onOnmaskBgETMouseUpChanged   = (val) => view.OnmaskBgETMouseUp = val;
     _onOnmaskBgETHoverExitChanged = (val) => view.OnmaskBgETHoverExit = val;
 }
Пример #3
0
        void ViewBind(CommonMaxMapView view)
        {
            BindingSet <CommonMaxMapView, CommonMaxMapViewModel> bindingSet =
                view.CreateBindingSet <CommonMaxMapView, CommonMaxMapViewModel>();

            bindingSet.Bind(view.rootLocation).For(v => v.anchoredPosition).To(vm => vm.rootLocation).OneWay();

            bindingSet.Build();
        }
Пример #4
0
        public override void CreateBinding(GameObject obj)
        {
            _viewGameObject = obj;
            _viewCanvas     = _viewGameObject.GetComponent <Canvas>();

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

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonMaxMapView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();

            if (bFirst)
            {
                SaveOriData(view);
            }
            _view    = view;
            viewBase = view;
        }
Пример #5
0
 void SaveOriData(CommonMaxMapView view)
 {
 }
Пример #6
0
 void DataInit(CommonMaxMapView view)
 {
 }
Пример #7
0
 private void EventTriggerBind(CommonMaxMapView view)
 {
 }
Пример #8
0
 void SaveOriData(CommonMaxMapView view)
 {
     view.orirootLocation = _rootLocation;
 }
Пример #9
0
 void DataInit(CommonMaxMapView view)
 {
     _rootLocation = view.rootLocation.anchoredPosition;
 }