Пример #1
0
 void SaveOriData(CommonChatView view)
 {
     view.oriShow                 = _show;
     view.oriAlpha                = _alpha;
     view.oriChatListBgShow       = _chatListBgShow;
     view.oriSendMessageGroupShow = _sendMessageGroupShow;
     view.oriChannelTipText       = _channelTipText;
     view.oriChannelTipColor      = _channelTipColor;
 }
Пример #2
0
 void DataInit(CommonChatView view)
 {
     _show                 = view.Show.activeSelf;
     _alpha                = view.Alpha.alpha;
     _chatListBgShow       = view.ChatListBgShow.enabled;
     _sendMessageGroupShow = view.SendMessageGroupShow.activeSelf;
     _channelTipText       = view.ChannelTipText.text;
     _channelTipColor      = view.ChannelTipColor.color;
 }
Пример #3
0
 void SaveOriData(CommonChatView view)
 {
     view.oriShow  = _show;
     view.oriAlpha = _alpha;
     view.oriSendMessageGroupShow = _sendMessageGroupShow;
     view.oriChannelTipText       = _channelTipText;
     view.oriChannelTipColor      = _channelTipColor;
     view.oriInputSize            = _inputSize;
     view.oriPrivateNameText      = _privateNameText;
     view.oriPrivateNameShow      = _privateNameShow;
 }
Пример #4
0
 void DataInit(CommonChatView view)
 {
     _show  = view.Show.activeSelf;
     _alpha = view.Alpha.alpha;
     _sendMessageGroupShow = view.SendMessageGroupShow.activeSelf;
     _channelTipText       = view.ChannelTipText.text;
     _channelTipColor      = view.ChannelTipColor.color;
     _inputSize            = view.InputSize.sizeDelta;
     _privateNameText      = view.PrivateNameText.text;
     _privateNameShow      = view.PrivateNameShow.activeSelf;
 }
Пример #5
0
        void ViewBind(CommonChatView view)
        {
            BindingSet <CommonChatView, CommonChatViewModel> bindingSet =
                view.CreateBindingSet <CommonChatView, CommonChatViewModel>();

            bindingSet.Bind(view.Show).For(v => v.activeSelf).To(vm => vm.Show).OneWay();
            bindingSet.Bind(view.Alpha).For(v => v.alpha).To(vm => vm.Alpha).OneWay();
            bindingSet.Bind(view.ChatListBgShow).For(v => v.enabled).To(vm => vm.ChatListBgShow).OneWay();
            bindingSet.Bind(view.SendMessageGroupShow).For(v => v.activeSelf).To(vm => vm.SendMessageGroupShow).OneWay();
            bindingSet.Bind(view.ChannelTipText).For(v => v.text).To(vm => vm.ChannelTipText).OneWay();
            bindingSet.Bind(view.ChannelTipColor).For(v => v.color).To(vm => vm.ChannelTipColor).OneWay();
            bindingSet.Bind(view.InputValueChanged).For(v => v.onValueChanged).To(vm => vm.InputValueChanged).OneWay();

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

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

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