IEnumerator CheckVersionContent() { string szVersionMark = GameInstance.Instance().proServerUrl + string.Format(GameInstance.Instance().proServerMarkPath, VersionManager.Instance().GetVersionUrl()) + "?" + Time.realtimeSinceStartup.ToString(); WWW www = new WWW(szVersionMark); SampleDebuger.Log("+++++++++++ checkVersionContent +++++++++++ "); yield return(www); if (!string.IsNullOrEmpty(www.error)) { SampleDebuger.Log(szVersionMark); AssetBundleLoader.Instance().LoadAsset(GameObjectConstant.GetABUIPath(GameObjectConstant.g_szConfirmPanel), GameObjectConstant.g_szConfirmPanel, delegate(UnityEngine.Object ob) { GameObject go_RoleList = Instantiate((GameObject)ob, MainCanvas.Instance().transform); go_RoleList.GetComponent <ConfirmPanel>().Init("检测到大版本更新,请前往官网或者应用商店下载最新版本", delegate(object ob1) { //todo 下载 SampleDebuger.LogGreen("begin down load"); }, null, delegate(object ob1) { //todo 取消下载 SampleDebuger.LogGreen("cancel down load"); }, null ); } ); yield break; } //下载更新包 if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) { m_comEnvChecker.StartDownload(); } else { AssetBundleLoader.Instance().LoadAsset(GameObjectConstant.GetABUIPath(GameObjectConstant.g_szConfirmPanel), GameObjectConstant.g_szConfirmPanel, delegate(UnityEngine.Object ob) { GameObject go_RoleList = Instantiate((GameObject)ob, MainCanvas.Instance().transform); go_RoleList.GetComponent <ConfirmPanel>().Init("检测到游戏更新,请点击更新!", delegate(object ob1) { m_comEnvChecker.StartDownload(); }, null, delegate(object ob1) { //todo 取消下载 SampleDebuger.LogGreen("cancel down load"); }, null ); } ); } }
public void OnLoginAckPlayerOnLinePlayer(byte[] pBuf) { GameProto.LoginAckPlayerOnLinePlayer oRet = GameProto.LoginAckPlayerOnLinePlayer.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.Log("OnLoginAckPlayerOnLinePlayer error parse"); return; } SampleDebuger.Log("online player ret : " + oRet.DwResult.ToString()); AssetBundleLoader.Instance().LoadAsset(GameObjectConstant.GetABUIPath(GameObjectConstant.g_szPlayerList), GameObjectConstant.g_szPlayerList, delegate(UnityEngine.Object ob) { RoleList pRoleList = RoleList.CreateInstance(ob, MainCanvas.Instance().transform); pRoleList.SetPlayerIds(oRet.QwPlayerId); } ); }
public void OnLoginNotifyPlayerInviteTeam(byte[] pBuf) { GameProto.LoginNotifyPlayerInviteTeam oRet = GameProto.LoginNotifyPlayerInviteTeam.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.Log("OnLoginAckPlayerOnLinePlayer error parse"); return; } SampleDebuger.Log("on invitee team player id : " + oRet.QwPlayerId.ToString() + " team id : " + oRet.QwTeamId.ToString()); AssetBundleLoader.Instance().LoadAsset(GameObjectConstant.GetABUIPath(GameObjectConstant.g_szConfirmPanel), GameObjectConstant.g_szConfirmPanel, delegate(UnityEngine.Object ob) { GameObject go_RoleList = Instantiate((GameObject)ob, MainCanvas.Instance().transform); go_RoleList.GetComponent <ConfirmPanel>().Init("player : " + oRet.QwPlayerId.ToString() + " invite you to team :" + oRet.QwTeamId.ToString(), IntoInviteTeam, oRet, NotIntoInviteTeam, oRet); } ); }
public void OnServerInfo(string szData) { SampleDebuger.Log(szData); ServerListInfo oServerList = JsonUtility.FromJson <ServerListInfo>(szData); if (oServerList.server_infos.Count == 0) { SampleDebuger.LogError("can't find server list!!!!"); return; } AssetBundleLoader.Instance().LoadAsset( GameObjectConstant.GetABUIPath(GameObjectConstant.g_szLoginServerList), GameObjectConstant.GetABName(GameObjectConstant.g_szLoginServerList), delegate(UnityEngine.Object ob) { LoginServerList pList = LoginServerList.CreateInstance(ob, MainCanvas.Instance().transform); pList.SetServerListInfo(oServerList); } ); }