protected override void InitComponents() { new UMinerMap().SetGameObj(gameObj); LoadUI <UIMinerBattle>(); AClientApis.OnEnterScene(); }
internal override void rcvLoginCb(bool bSuccess, string uid, PktLoginRequest.EPartnerID ePartnerID) { if (bSuccess) { AClientApis.OnEnterGame(uid, ePartnerID); } AOutput.Log($"rcvLoginCb {bSuccess}, {uid}"); }
private void OnCreatePlayer(UEventBase obj) { var eb = obj as EventCreatePlayer; if (eb.pkt.psid == LibClient.GameObj.CakeAvatar.myID) { UILoading.Instance.OnUnloadThis(); } AClientApis.OnBeginFight(); }
protected override void InitComponents() { textRet = FindWidget <Text>("textRet"); textRet.text = ""; var btnReturnCity = FindWidget <Button>("btnReturnCity"); btnReturnCity.onClick.AddListener(() => { AClientApis.OnEnterCity(); }); }
public override void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { if (bSuccess) { AClientApis.OnEnterGame(); } UEventListener.Instance.OnDispatchEvent(UEvents.Login, new EventLogin() { bSuccess = bSuccess }); }
private void OnCreateAvatarCb(UEventBase obj) { var res = obj as EventCreateAvatar; UICommonTips.AddTip($"Create avatar {res.eResult}"); if (res.eResult == PktCreateAvatarResult.EResult.Success) { OnUnloadThis(); AClientApis.OnGetSdata(); } }
internal override void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { if (bSuccess) { AClientApis.OnEnterGame(); } else { UEventListener.Instance.OnDispatchEvent(UEvents.LoginFailed, new EventLoginFailed()); } AOutput.Log($"rcvLoginCb {bSuccess}, {uid}"); }
private void OnEnterGameCb(UEventBase obj) { AHotBase.UnloadAllClasses(); var eb = obj as EventEnterGame; if (eb.info == null) { AHotBase.LoadUI <UIMinerCreateAvatar>(); } else { AClientApis.OnGetSdata(); } }
private void OnLogin() { if (string.IsNullOrEmpty(inputUsername.text)) { return; } if (string.IsNullOrEmpty(inputPassword.text)) { return; } var username = inputUsername.text; var password = inputPassword.text; AClientApis.OnLogin(username, MD5String.Hash32(password), EPartnerID.Test); }
protected override void InitComponents() { LoadUI <UIMinerMain>(); foreach (var wx in InitValueDefs.wuxing.Keys) { var swx = wx; var btn = FindWidget <Button>(swx); var str = $"{InitValueDefs.wuxing[swx]} {CakeClient.GetCake("pinfo", CakeAvatar.myID).GetIntValue(swx)}级"; FindWidget <Text>(btn.transform, "Text").text = str; btn.onClick.AddListener(() => { OnEnterYuansuConta(swx); }); } AClientApis.OnEnterScene(); }
protected override void InitComponents() { btnReturn = FindWidget <Button>("btnReturn"); btnReturn.onClick.AddListener(() => { OnUnloadThis(); LoadAnotherUI <UIMinerLogin>(); }); inputNickname = FindWidget <InputField>("inputNickname"); inputNickname.text = ""; btnMale = FindWidget <Button>("btnMale"); btnMale.onClick.AddListener(() => { bMale = true; }); selMale = FindWidget <Transform>(btnMale.transform, "sel"); btnFemale = FindWidget <Button>("btnFemale"); btnFemale.onClick.AddListener(() => { bMale = false; }); selFemale = FindWidget <Transform>(btnFemale.transform, "sel"); bMale = true; btnCreate = FindWidget <Button>("btnCreate"); btnCreate.onClick.AddListener(() => { var nickname = inputNickname.text; if (string.IsNullOrEmpty(nickname)) { return; } AClientApis.OnCreateAvatar(nickname, bMale ? 1 : 0); }); UEventListener.Instance.OnRegisterEvent(UEvents.CreateAvatar, OnCreateAvatarCb); }
protected override void InitComponents() { btnDailyCheck = FindWidget <Button>("btnDailyCheck"); btnDailyCheck.onClick.AddListener(() => { AClientApis.OnDailyCheck(); }); var textUsername = FindWidget <Text>("textUsername"); textUsername.text = CakeClient.GetCake("pinfo", CakeAvatar.myID).GetStringValue(ParamNameDefs.AvatarName); textGold = FindWidget <Text>("textGold"); textGold.text = "0"; textDiamond = FindWidget <Text>("textDiamond"); textDiamond.text = "0"; var btnLogout = FindWidget <Button>("btnLogout"); btnLogout.onClick.AddListener(() => { AClientApp.OnDisconnect(); OnUnloadThis(); LoadAnotherUI <UIMinerLogin>(); }); var btnPay = FindWidget <Button>("btnPay"); btnPay.onClick.AddListener(() => { //AClientApis.OnPay(1); AClientApis.OnCreateOrder(1); }); var btnExchange = FindWidget <Button>("btnExchange"); btnExchange.onClick.AddListener(() => { AClientApis.OnExchange(1); }); OnParamUpdateCb(null); RegisterEvent(UEvents.ParamUpdate, OnParamUpdateCb); RegisterEvent(UEvents.EventCreateOrder, OnCreateOrderCb); //var map01 = LoadClass<UMinerMap>("UI/MinerMap/Map01"); AClientApis.OnGetSdata(""); OnRegistAction(str => { UICommonWait.Hide(); var astrs = str.Split(' '); switch (astrs[0]) { case "ProvideContent": UIAlert.Show("ProvideContent " + str); break; case "FailedTransactions": UIAlert.Show("FailedTransactions " + str); break; case "UpdateTransactions": UIAlert.Show("UpdateTransactionss " + str); break; } }); }
private void OnEnterYuansuConta(string swx) { AClientApis.OnEnterConta(swx); }
private void OnLogin(string[] sCmds) { AClientApis.OnLogin(sCmds[1], sCmds[2], LibPacket.PktLoginRequest.EPartnerID.Test); }
private void OnLogin(string[] sCmds) { AClientApis.OnLogin(sCmds[1], sCmds[2], EPartnerID.Test); }
private void OnLogin(string[] sCmds) { AClientApis.OnLogin(sCmds[1], MD5String.Hash32(sCmds[2]), EPartnerID.Test); }