예제 #1
0
 void SaveOriData(WeaponPropertyBarItemView view)
 {
     view.oriProgressBgActiveSelf            = _progressBgActiveSelf;
     view.oriProgressBgSizeDelta             = _progressBgSizeDelta;
     view.oriPropertyNameText                = _propertyNameText;
     view.oriCurrentBarImageActiveSelf       = _currentBarImageActiveSelf;
     view.oriCurrentBarImageSizeDelta        = _currentBarImageSizeDelta;
     view.oriCurrentBarImageAnchoredPosition = _currentBarImageAnchoredPosition;
     view.oriMissBarImageActiveSelf          = _missBarImageActiveSelf;
     view.oriMissBarImageAnchoredPosition    = _missBarImageAnchoredPosition;
     view.oriMissBarImageSizeDelta           = _missBarImageSizeDelta;
     view.oriAddBarImageActiveSelf           = _addBarImageActiveSelf;
     view.oriAddBarImageAnchoredPosition     = _addBarImageAnchoredPosition;
     view.oriAddBarImageSizeDelta            = _addBarImageSizeDelta;
     view.oriDownImageActiveSelf             = _downImageActiveSelf;
     view.oriUpImageActiveSelf               = _upImageActiveSelf;
     view.oriNumberText = _numberText;
 }
예제 #2
0
 void DataInit(WeaponPropertyBarItemView view)
 {
     _progressBgActiveSelf            = view.ProgressBgActiveSelf.activeSelf;
     _progressBgSizeDelta             = view.ProgressBgSizeDelta.sizeDelta;
     _propertyNameText                = view.PropertyNameText.text;
     _currentBarImageActiveSelf       = view.CurrentBarImageActiveSelf.activeSelf;
     _currentBarImageSizeDelta        = view.CurrentBarImageSizeDelta.sizeDelta;
     _currentBarImageAnchoredPosition = view.CurrentBarImageAnchoredPosition.anchoredPosition;
     _missBarImageActiveSelf          = view.MissBarImageActiveSelf.activeSelf;
     _missBarImageAnchoredPosition    = view.MissBarImageAnchoredPosition.anchoredPosition;
     _missBarImageSizeDelta           = view.MissBarImageSizeDelta.sizeDelta;
     _addBarImageActiveSelf           = view.AddBarImageActiveSelf.activeSelf;
     _addBarImageAnchoredPosition     = view.AddBarImageAnchoredPosition.anchoredPosition;
     _addBarImageSizeDelta            = view.AddBarImageSizeDelta.sizeDelta;
     _downImageActiveSelf             = view.DownImageActiveSelf.activeSelf;
     _upImageActiveSelf               = view.UpImageActiveSelf.activeSelf;
     _numberText = view.NumberText.text;
 }
예제 #3
0
        void ViewBind(WeaponPropertyBarItemView view)
        {
            BindingSet <WeaponPropertyBarItemView, WeaponPropertyBarItemViewModel> bindingSet =
                view.CreateBindingSet <WeaponPropertyBarItemView, WeaponPropertyBarItemViewModel>();

            bindingSet.Bind(view.ProgressBgActiveSelf).For(v => v.activeSelf).To(vm => vm.ProgressBgActiveSelf).OneWay();
            bindingSet.Bind(view.ProgressBgSizeDelta).For(v => v.sizeDelta).To(vm => vm.ProgressBgSizeDelta).OneWay();
            bindingSet.Bind(view.PropertyNameText).For(v => v.text).To(vm => vm.PropertyNameText).OneWay();
            bindingSet.Bind(view.CurrentBarImageActiveSelf).For(v => v.activeSelf).To(vm => vm.CurrentBarImageActiveSelf).OneWay();
            bindingSet.Bind(view.CurrentBarImageSizeDelta).For(v => v.sizeDelta).To(vm => vm.CurrentBarImageSizeDelta).OneWay();
            bindingSet.Bind(view.CurrentBarImageAnchoredPosition).For(v => v.anchoredPosition).To(vm => vm.CurrentBarImageAnchoredPosition).OneWay();
            bindingSet.Bind(view.MissBarImageActiveSelf).For(v => v.activeSelf).To(vm => vm.MissBarImageActiveSelf).OneWay();
            bindingSet.Bind(view.MissBarImageAnchoredPosition).For(v => v.anchoredPosition).To(vm => vm.MissBarImageAnchoredPosition).OneWay();
            bindingSet.Bind(view.MissBarImageSizeDelta).For(v => v.sizeDelta).To(vm => vm.MissBarImageSizeDelta).OneWay();
            bindingSet.Bind(view.AddBarImageActiveSelf).For(v => v.activeSelf).To(vm => vm.AddBarImageActiveSelf).OneWay();
            bindingSet.Bind(view.AddBarImageAnchoredPosition).For(v => v.anchoredPosition).To(vm => vm.AddBarImageAnchoredPosition).OneWay();
            bindingSet.Bind(view.AddBarImageSizeDelta).For(v => v.sizeDelta).To(vm => vm.AddBarImageSizeDelta).OneWay();
            bindingSet.Bind(view.DownImageActiveSelf).For(v => v.activeSelf).To(vm => vm.DownImageActiveSelf).OneWay();
            bindingSet.Bind(view.UpImageActiveSelf).For(v => v.activeSelf).To(vm => vm.UpImageActiveSelf).OneWay();
            bindingSet.Bind(view.NumberText).For(v => v.text).To(vm => vm.NumberText).OneWay();

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

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

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