示例#1
0
        /// <summary>
        /// 接口监听事件
        /// </summary>
        /// <param name="componentName">组件名字</param>
        /// <param name="eventType">继承接口类型</param>
        /// <param name="action">回调</param>
        public void OnEventHandler(string itemName, string componentName, EventTriggerType eventType, UnityAction <BaseEventData> action)
        {
            UISubMgr tmp = GetGameObject <UISubMgr>(itemName);

            if (tmp != null)
            {
                tmp.EventHandler(componentName, eventType, action);
            }
        }
示例#2
0
        public void SetRawImage(string itemName, string componentName, Texture spr)
        {
            UISubMgr tmp = GetGameObject <UISubMgr>(itemName);

            if (tmp != null)
            {
                tmp.SetRawImage(componentName, spr);
            }
        }
示例#3
0
        public void SetText(string itemName, string componentName, string str)
        {
            UISubMgr tmp = GetGameObject <UISubMgr>(itemName);

            if (tmp != null)
            {
                tmp.SetText(componentName, str);
            }
        }
示例#4
0
        public void AddSliderListener(string itemName, string componentName, UnityAction <float> action)
        {
            UISubMgr tmp = GetGameObject <UISubMgr>(itemName);

            if (tmp != null)
            {
                tmp.AddSliderListener(componentName, action);
            }
        }
示例#5
0
        public void AddInputFieldValueChangedListener(string itemName, string componentName, UnityAction <string> action)
        {
            UISubMgr tmp = GetGameObject <UISubMgr>(itemName);

            if (tmp != null)
            {
                tmp.AddInputFieldValueChangedListener(componentName, action);
            }
        }
示例#6
0
        private void Start()
        {
            loginModel = new LoginModel();
            loginLogic = new LoginLogic(loginModel);


            Ninput_Account = GetGameObject <InputField>("Ninput_Account");
            Ninput_Psd     = GetGameObject <InputField>("Ninput_Psd");

            AddButtonListener("Nbtn_Login", loginLogic.OnClick);

            AddInputFieldEndEditListener("Ninput_Account", loginLogic.AccountEndEdit);
            AddInputFieldEndEditListener("Ninput_Psd", loginLogic.PasswordEndEdit);

            SetText("Ntxt", "赋值text");


            OnEventHandler("Ntxt", EventTriggerType.Drag, DragCallback);


            subMgr = GetGameObject <UISubMgr>("itemName");
            subMgr.SetText("txt_C", "laowang");
        }