Exemple #1
0
 void SaveOriData(CommonParachuteView view)
 {
     view.oriShow = _show;
     view.oriHeightSliderValue      = _heightSliderValue;
     view.oriHandleScale            = _handleScale;
     view.oriHeightTipGroupPosition = _heightTipGroupPosition;
     view.oriSpeedString            = _speedString;
 }
Exemple #2
0
 void DataInit(CommonParachuteView view)
 {
     _show = view.Show.activeSelf;
     _heightSliderValue      = view.HeightSliderValue.value;
     _handleScale            = view.HandleScale.localScale;
     _heightTipGroupPosition = view.HeightTipGroupPosition.localPosition;
     _speedString            = view.SpeedString.text;
 }
Exemple #3
0
        void ViewBind(CommonParachuteView view)
        {
            BindingSet <CommonParachuteView, CommonParachuteViewModel> bindingSet =
                view.CreateBindingSet <CommonParachuteView, CommonParachuteViewModel>();

            bindingSet.Bind(view.Show).For(v => v.activeSelf).To(vm => vm.Show).OneWay();
            bindingSet.Bind(view.HeightSliderValue).For(v => v.value).To(vm => vm.HeightSliderValue).OneWay();
            bindingSet.Bind(view.HandleScale).For(v => v.localScale).To(vm => vm.HandleScale).OneWay();
            bindingSet.Bind(view.HeightTipGroupPosition).For(v => v.localPosition).To(vm => vm.HeightTipGroupPosition).OneWay();
            bindingSet.Bind(view.SpeedString).For(v => v.text).To(vm => vm.SpeedString).OneWay();

            bindingSet.Build();
        }
Exemple #4
0
        public void CreateBinding(GameObject obj)
        {
            _viewGameObject = obj;
            _viewCanvas     = _viewGameObject.GetComponent <Canvas>();

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

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonParachuteView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Exemple #5
0
 private void EventTriggerBind(CommonParachuteView view)
 {
 }