Пример #1
0
 void SaveOriData(CommonTipView view)
 {
     view.orirootLocation        = _rootLocation;
     view.orirootActiveSelf      = _rootActiveSelf;
     view.oritypeText            = _typeText;
     view.orinameText            = _nameText;
     view.oriinfoOneText         = _infoOneText;
     view.oriinfoOneActiveSelf   = _infoOneActiveSelf;
     view.oriinfoTwoText         = _infoTwoText;
     view.oriinfoTwoActiveSelf   = _infoTwoActiveSelf;
     view.oriattrGroupActiveSelf = _attrGroupActiveSelf;
     view.oridesTextActiveSelf   = _desTextActiveSelf;
     view.oridesText             = _desText;
 }
Пример #2
0
 void DataInit(CommonTipView view)
 {
     _rootLocation        = view.rootLocation.anchoredPosition;
     _rootActiveSelf      = view.rootActiveSelf.activeSelf;
     _typeText            = view.typeText.text;
     _nameText            = view.nameText.text;
     _infoOneText         = view.infoOneText.text;
     _infoOneActiveSelf   = view.infoOneActiveSelf.activeSelf;
     _infoTwoText         = view.infoTwoText.text;
     _infoTwoActiveSelf   = view.infoTwoActiveSelf.activeSelf;
     _attrGroupActiveSelf = view.attrGroupActiveSelf.activeSelf;
     _desTextActiveSelf   = view.desTextActiveSelf.activeSelf;
     _desText             = view.desText.text;
 }
Пример #3
0
        void ViewBind(CommonTipView view)
        {
            BindingSet <CommonTipView, CommonTipViewModel> bindingSet =
                view.CreateBindingSet <CommonTipView, CommonTipViewModel>();

            bindingSet.Bind(view.rootLocation).For(v => v.anchoredPosition).To(vm => vm.rootLocation).OneWay();
            bindingSet.Bind(view.rootActiveSelf).For(v => v.activeSelf).To(vm => vm.rootActiveSelf).OneWay();
            bindingSet.Bind(view.typeText).For(v => v.text).To(vm => vm.typeText).OneWay();
            bindingSet.Bind(view.nameText).For(v => v.text).To(vm => vm.nameText).OneWay();
            bindingSet.Bind(view.infoOneText).For(v => v.text).To(vm => vm.infoOneText).OneWay();
            bindingSet.Bind(view.infoOneActiveSelf).For(v => v.activeSelf).To(vm => vm.infoOneActiveSelf).OneWay();
            bindingSet.Bind(view.infoTwoText).For(v => v.text).To(vm => vm.infoTwoText).OneWay();
            bindingSet.Bind(view.infoTwoActiveSelf).For(v => v.activeSelf).To(vm => vm.infoTwoActiveSelf).OneWay();
            bindingSet.Bind(view.Icon).For(v => v.sprite).To(vm => vm.Icon).OneWay();
            bindingSet.Bind(view.attrGroupActiveSelf).For(v => v.activeSelf).To(vm => vm.attrGroupActiveSelf).OneWay();
            bindingSet.Bind(view.desTextActiveSelf).For(v => v.activeSelf).To(vm => vm.desTextActiveSelf).OneWay();
            bindingSet.Bind(view.desText).For(v => v.text).To(vm => vm.desText).OneWay();

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

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

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <CommonTipView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Пример #5
0
 private void EventTriggerBind(CommonTipView view)
 {
 }