public void SetText(string itemName, string componentName, string str) { UISubMgr tmp = GetGameObject <UISubMgr>(itemName); if (tmp != null) { tmp.SetText(componentName, str); } }
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"); }