public void NameModifyPop() { if (MainUI.Instance.GetPopState(MainUI.PopType.UserNameModify) != true) { GameObject obj = Instantiate(pop.namePop); obj.SetActive(true); ModifyNamePop p = obj.GetComponent <ModifyNamePop>(); p.InitData(UserManager.Instance.nickName); p.transform.parent = pop.transform.parent; p.transform.localScale = Vector3.one; MainUI.Instance.SetPopState(MainUI.PopType.UserNameModify, true); } }
public void ModifyName(ModifyNamePop p, string str) { if (str.Equals("")) { ToastManager.Instance.Show("不能为空"); } else if (!UserManager.Instance.canModifyName && UserManager.Instance.diamond < Def.ModifyNameDimand && !UserManager.Instance.canModifyName) { MainUI.Instance.DiomandToClick(); } else { namePop = p; C2sSprotoType.user_modify_name.request obj = new C2sSprotoType.user_modify_name.request(); obj.name = str; namePop.saveNameBtn.isEnabled = false; NetworkManager.Instance.UserNameModify(obj); } }
public void UserModifyNameCallback(C2sSprotoType.user_modify_name.response resp) { namePop.saveNameBtn.isEnabled = true; if (namePop != null && resp.errorcode == 1) { //LuaFunction f = l.GetFunction("ModifyNameCallBack"); //f.Call(namePop); UserManager.Instance.nickName = namePop.name.label.text; pop.SetName(UserManager.Instance.nickName); if (!UserManager.Instance.canModifyName) { UserManager.Instance.SubDiamond(Def.ModifyNameDimand); } else { UserManager.Instance.canModifyName = false; } namePop.CloseClick(); } namePop = null; }
public void RandomName(ModifyNamePop p) { namePop = p; namePop.randomNameBtn.isEnabled = false; NetworkManager.Instance.UserRandomNameModify(); }