public static void OpenLangSel() { LanguageSelectCtrl ctrl = WsWindow.Open <LanguageSelectCtrl>(WsWindow.LanguageSelect); RectTransform rectTran = ctrl.GetComponent <RectTransform>(); if (rectTran != null) { rectTran.sizeDelta = new Vector2(0, 0); } ctrl.UpdateUI(); }
//显示0-4 全部-道术师-步兵-骑兵-弓弩手 供招募的 public static void ShowEmploy(int type) { ArmyShopCtrl ctrl = WsWindow.Open <ArmyShopCtrl>(WsWindow.ArmyShop); RectTransform rectTran = ctrl.GetComponent <RectTransform>(); if (rectTran != null) { rectTran.sizeDelta = new Vector2(0, 0); //rectTran.anchorMin = new Vector2(0, 0); //rectTran.anchorMax = new Vector2(1, 1); } ctrl.BindArmyType(type); ctrl.Reset(); ctrl.UpdateUI(); }
/* * public void OnConnect(CBase result) * { * GameObject loading = U3D.ShowLoading(); * ConnResult connRet = result as ConnResult; * if (connRet != null) * { * if (!connRet.success) * U3D.btn.gameObject.SetActive(true); * else * OnConnectSuccess(); * } * } */ /* * public void OnDisConnect() * { * if (!GameData.anotherLogined) * { * U3D.PopupTip("服务器断开连接, 正在尝试重新连接"); * CancelInvoke("HeartBeat"); * U3D.CloseLoading(); * U3D.ShowLoading(); * } * } */ /* * public static void OnSynServerList(RBase rsp) * { * ResponGetServerList Rsp = rsp as ResponGetServerList; * if (Rsp != null && Rsp.lst != null) * GameData.server = Rsp.lst; * if (GameData.server != null && GameData.server.Count != 0) * { * ins.ServerIdx = GameData.server[0].Idx; * ins.GameServerIP = GameData.server[0].ServerIP; * ins.ServerName = GameData.server[0].ServerName; * ins.ServerPort = GameData.server[0].ServerPort; * LoginCtrl ctrl = WsWindow.Open<LoginCtrl>(WsWindow.RegAndLogin); * U3D.CloseLoading(); * } * else * ins.OnConnectSuccess(); * } */ /* * public void OnConnectSuccess() * { * //其他设备把此设备挤出去了. * if (GameData.anotherLogined) * return; * //已经登录过的,尝试重连. * if (GameData.logined) * { * ClientProxy.OnClickLogin(GameData.account.lastAccount, GameData.account.lastPassword, * delegate (RBase rsp) * { * Common.OnAuthRsp(rsp, delegate (RBase rsp2) { * //如果重连,那么发过来的信息,结构体不是UserInfo,而是一个可以恢复玩家 线路,角色,和状态的一个包。 * //这个重连等能进游戏再回过头来做 * OnSyncRoleStatus(rsp2); * }); * }); * } * else * ClientProxy.UpdateGameServer(OnSynServerList); * } * * void HeartBeat() * { * cnt--; * if (cnt <= 0) * { * U3D.ShowLoading(); * return; * } * Common.SendHeartBeat(OnHeartBeat); * } * * int cnt = 4; * void OnHeartBeat(RBase rq) * { * U3D.PopupTip("心跳成功"); * cnt = 4; * } * * public void OnSyncRoleStatus(RBase rsp) * { * //需要线路信息1,角色编号信息2,2者有了,又登录了的情况下。是可以恢复角色状态的.若恢复失败,则告知需要重新登录. * U3D.PopupTip("状态重连 还没做,流程是对的。先做状态同步"); * } * * public void OnLoginSuccess() * { * //InvokeRepeating("HeartBeat", 15.0f, 15.0f); * U3D.CloseLoading(); * WsWindow.Close(WsWindow.RegAndLogin); * ShowServerInfo(); * } * * void ShowServerInfo() * { * WsWindow.Open(WsWindow.ServerInfo); * } * * public void ShowRoleInfo() * { * WsWindow.Close(WsWindow.ServerInfo); * GameObject panel = WsWindow.Open(WsWindow.RoleInfo); * } */ public void EntryNextTitle() { WsWindow.Open(WsWindow.UIPage); }
static void BattleInit() { WsWindow.Close(WsWindow.Dialogue);//进战斗前必须把交互对话框关闭. WsWindow.Close(WsWindow.Battle); WsWindow.Open(WsWindow.Battle); }