/*void Update() * { * * }*/ /// <summary> 设置物品数据 </summary> public void SetItemData(PlayerBagItem pbi, ItemConfig itemCfg, List <ulong> IDLst) { gameObject.SetActive(true); SerItemInfo = pbi; ItemCfg = itemCfg; Icon.spriteName = ItemCfg.Icon; Icon.MakePixelPerfect(); Icon.transform.localScale = Vector3.one * 1.2f; Name.text = ItemCfg.Name; Num.text = pbi.m_item_count.ToString(); if (ItemCfg.Describe.Length > 38) { Des.text = StringBuilderTool.ToInfoString(ItemCfg.Describe.Substring(0, 36), "..."); } else { Des.text = ItemCfg.Describe; } for (int i = 0; i < IDLst.Count; i++) { if (SerItemInfo.m_id == IDLst[i]) { SetSelState(true); break; } } }
void Start() { if (CsvConfigTables.Instance.RoleCsvDic.TryGetValue((int)RoleID, out rc)) { GameObject model = Resources.Load <GameObject>(StringBuilderTool.ToString("Prefabs/Actor/", rc.ModelName)); if (model != null) { GameObject obj = GameObject.Instantiate(model); MyTools.setLayerDeep(obj, LayerMask.NameToLayer("UI")); Root = obj.transform; Root.parent = transform; Root.localPosition = new Vector3(0, -216, -300); Root.localEulerAngles = new Vector3(0, RoleID < 1000 ? 180 : -140, 0); Root.localScale = Vector3.one * RoleModelScale; animation = Root.GetComponent <Animation>(); animator = Root.GetComponent <Animator>(); Name.text = rc.Name; if (rc.UnLockType != 0) { LockIcon.SetActive(true); UnLockConditionLab.text = rc.GetUnLockConditionDes(); } } } //Refresh(); }
void Awake() { for (int i = 0; i < StageGroups.Length; i++) { string[] split = StageGroups[i].name.Split('_'); if (split.Length == 3) { if (split[1].Contains("Open") || split[1].Contains("Close")) { StageGroups[i].gameObject.SetActive(false); Transform t = null; #if UNITY_ANDROID t = StageGroups[i].transform.parent.Find(StringBuilderTool.ToInfoString("StageGroup_Open_", split[2])); #elif UNITY_IPHONE t = StageGroups[i].transform.parent.Find(StringBuilderTool.ToInfoString("StageGroup_Close_", split[2])); #endif if (t != null) { t.gameObject.SetActive(true); UI_StageGroup sg = t.GetComponent <UI_StageGroup>(); if (sg != null) { StageGroups[i] = sg; } } } } } }
IEnumerator _AutoBeginFight() { int cd = GameApp.Instance.GetParameter("AutoBeginFight"); while (cd > 0) { while ((GameApp.Instance.CurRoomPlayerLst.Count == 1)) { AutoBeginFightHint.gameObject.SetActive(false); cd = GameApp.Instance.GetParameter("AutoBeginFight"); yield return(new WaitForSeconds(1)); } AutoBeginFightHint.gameObject.SetActive(true); if (!PauseAutoBeginFight) { AutoBeginFightHint.text = StringBuilderTool.ToString((cd--), "秒自动开始游戏"); } if (cd <= 10) { GameApp.Instance.CommonHintDlg.OpenHintBox(AutoBeginFightHint.text); } yield return(new WaitForSeconds(1)); } OnClick_GotoFight(); }
IEnumerator RefreshCardList() { MyTools.DestroyChildNodes(CardTable.transform); CommodityWaitLoad.SetActive(true); int CurProg = 0; foreach (MagicCardConfig CardCfg in TempToExchangeCardLst) { GameObject newUnit = NGUITools.AddChild(CardTable.gameObject, CardUnit_CardPrefab); newUnit.SetActive(true); newUnit.name = "Card_" + CardCfg.CardID; UI_MagicCard mc = newUnit.GetComponent <UI_MagicCard>(); mc.UnconditionalShow(CardCfg.CardID); CardTable.repositionNow = true; yield return(new WaitForEndOfFrame()); CardLstRoot.GetComponent <UIScrollView>().ResetPosition(); CurProg++; CommodityLoadProgLab.text = StringBuilderTool.ToString("卡牌加载中(", CurProg, "/", TempToExchangeCardLst.Count, ")..."); } CommodityWaitLoad.SetActive(false); }
/// <summary> 获取解锁条件文字描述 </summary> public string GetUnLockConditionDes() { switch (UnLockType) { default: case 0: return(""); case 1: string[] TempSplit = UnLockCondition.Split('_'); if (TempSplit.Length == 3) { ChapterConfig cc = null; if (CsvConfigTables.Instance.ChapterCsvDic.TryGetValue(int.Parse(TempSplit[0]), out cc)) { GroupConfig gc = null; if (CsvConfigTables.Instance.GroupCsvDic.TryGetValue(int.Parse(TempSplit[1]), out gc)) { StageConfig sc = null; if (CsvConfigTables.Instance.StageCsvDic.TryGetValue(int.Parse(TempSplit[2]), out sc)) { return(StringBuilderTool.ToInfoString("通关 " + cc.Name, "-", gc.Name, "-" + sc.Name)); } } } } return("解锁条件数据格式错误!"); case 2: return("充值" + float.Parse(UnLockCondition) + "元"); } }
IEnumerator WaitToCheckRoleName() { while (curHttpResult == HttpResult.ConnectContinue) { yield return(new WaitForEndOfFrame()); } if (curHttpResult == HttpResult.ConnectException) { GameApp.Instance.CommonMsgDlg.OpenSimpleMsgBox(StringBuilderTool.ToInfoString("连接异常!\nWaitToCheckRoleName\n", ConnectExceptionInfo)); Clear(); yield break; } else { LitJson.JsonData jsonRes = LitJson.JsonMapper.ToObject(platformRetStrInfo); if (jsonRes["status"].ToString() == "0") { //GameApp.Instance.CommonHintDlg.OpenHintBox("角色名可用!"); } else { //GameApp.Instance.CommonMsgDlg.OpenSimpleMsgBox("角色名不可用!"); } } Clear(); }
public void Set(MailItemInfo mii) { CurMII = mii; Name.text = mii.Name; Residue.text = StringBuilderTool.ToString(mii.Residue, "天"); if (mii.IsReadAndGet) { Bg.spriteName = "bg_yeqian_0"; if (mii.IsHasItem()) { HasItemSign.spriteName = "icon_baoxiang_0_hui"; } } else { Bg.spriteName = "bg_yeqian_2"; if (mii.IsHasItem()) { HasItemSign.spriteName = "icon_baoxiang_0"; } } LastBgSpriteName = Bg.spriteName; }
void UpdateExitRes() { Action Over = () => { CancelInvoke("UpdateExitRes"); GameApp.SendMsg.EndWaitUI(); }; string ExitRes = TestPlugins.Call <string>("GetExitRes"); Debug.Log(StringBuilderTool.ToInfoString("退出结果:", ExitRes)); if (ExitRes.Length > 0) { switch (ExitRes) { case "Wait": break; case "Success": Over(); Application.Quit(); break; case "Cancel": Over(); break; } } }
void UpdateLoginRes() { Action Over = () => { CancelInvoke("UpdateLoginRes"); GameApp.SendMsg.EndWaitUI(); }; string LoginRes = TestPlugins.Call <string>("GetLoginRes"); Debug.Log(StringBuilderTool.ToInfoString("登陆结果:", LoginRes)); string[] s = LoginRes.Split('_'); if (s.Length > 0) { switch (s[0]) { case "Wait": break; case "Success": Debug.Log("登录成功!"); Over(); SDKInfo.AccessToken = s[1]; SDKInfo.UserId = int.Parse(s[2]); SDKInfo.UserName = s[3]; Debug.Log(StringBuilderTool.ToInfoString("AccessToken:", SDKInfo.AccessToken)); Debug.Log(StringBuilderTool.ToString("UserId:", SDKInfo.UserId)); Debug.Log(StringBuilderTool.ToInfoString("UserName:", SDKInfo.UserName)); GameApp.Instance.UILogin.RecordNickName = SDKInfo.UserName; GameApp.Instance.UILogin.Account = SDKInfo.UserName; GameApp.Instance.Platform.LeSDKLogin(s[1]); break; case "NullUserInfo": GameApp.Instance.CommonMsgDlg.OpenSimpleMsgBox("登录异常!用户信息为空!"); Over(); break; case "Failure": GameApp.Instance.CommonMsgDlg.OpenSimpleMsgBox(StringBuilderTool.ToInfoString("登录失败!\n错误码:", s[1], "\n错误描述:", s[2])); Over(); break; case "Cancel": Debug.Log("取消登录!"); Over(); //清空数据,等待重新登陆... SDKInfo = new LeSDKInfo(); GameApp.Instance.Platform.PlatformInfo = new KOIPlatformInfo(); GameApp.Instance.UILogin.ShowLeSDKLogin(); break; } } }
IEnumerator RefreshAccumulativeLoginList() { string AccumulativeLoginKey = StringBuilderTool.ToString(SerPlayerData.GetAccountID(), "_AccumulativeLogin"); if (!PlayerPrefs.HasKey(AccumulativeLoginKey)) { PlayerPrefs.SetString(AccumulativeLoginKey, DateTime.Now.Ticks.ToString()); } string LastTime = PlayerPrefs.GetString(AccumulativeLoginKey); DateTime dtLastTime = new DateTime(long.Parse(LastTime)); TimeSpan ResidueTime = DateTime.Now - dtLastTime; MyTools.DestroyChildNodes(AccumulativeLoginGrid.transform); UIScrollView sv = AccumulativeLoginGrid.transform.parent.GetComponent <UIScrollView>(); for (int i = 1; i <= 31; i++) { GameObject newUnit = NGUITools.AddChild(AccumulativeLoginGrid.gameObject, AccumulativeLoginUnitPrefab); newUnit.SetActive(true); newUnit.name = "AccumulativeLoginUnit_" + i; newUnit.transform.localPosition = new Vector3(0, -140 * (i - 1), 0); UI_AccumulativeLoginUnit alu = newUnit.GetComponent <UI_AccumulativeLoginUnit>(); alu.Set(i, ResidueTime.Days + 1); sv.ResetPosition(); AccumulativeLoginGrid.repositionNow = true; yield return(new WaitForEndOfFrame()); } }
//void Start() //{ //} //void Update() //{ //} /// <summary> 设置道具数据 </summary> public void SetItemData(int itemID, int itemCount) { gameObject.SetActive(true); CsvConfigTables.Instance.ItemCsvDic.TryGetValue(itemID, out ItemCfg); if (ItemCfg != null) { if (ItemCfg.Type == 2) { Icon.enabled = false; UITexture cardIcon = Icon.gameObject.AddComponent <UITexture>(); cardIcon.mainTexture = Resources.Load(StringBuilderTool.ToInfoString("MagicCard/", ItemCfg.GetIcon())) as Texture; cardIcon.width = 40; cardIcon.height = 60; cardIcon.depth = 14; } else { Icon.spriteName = ItemCfg.Icon; Icon.MakePixelPerfect(); } Name.text = StringBuilderTool.ToString(ItemCfg.Name, "x", itemCount); } }
private void PlayBgmClip(string bgmName, float fadeInTime, bool loopBgm = true, bool willRest = false) { AudioSource currentAs; if (willRest) { currentAs = m_TrackBgmNRest; m_CurrentBgmNRestName = bgmName; } else { m_ActiveBgmTrack = (m_ActiveBgmTrack + 1) % 2; currentAs = m_TrackBgm[m_ActiveBgmTrack]; m_CurrentBgmName = bgmName; } AudioClip clip = Resources.Load(StringBuilderTool.ToInfoString("Sound/Bgm/", bgmName)) as AudioClip; currentAs.enabled = true; currentAs.clip = clip; currentAs.volume = 0.011f; currentAs.loop = loopBgm; currentAs.Play(); TweenVolume tv = TweenVolume.Begin(currentAs.gameObject, fadeInTime, (float)m_CurrentBgmVol / 100.0f); tv.eventReceiver = gameObject; tv.callWhenFinished = "PlayBgmFadeEnd"; }
public void OnClick_Sel() { GameApp.Instance.SoundInstance.PlaySe("button"); Debug.Log(StringBuilderTool.ToInfoString(gameObject.name, "UI_StampUnit OnClick_Sel")); GameApp.Instance.HomePageUI.Coloring.ChangeStamp(int.Parse(MyTools.GetLastString(gameObject.name, '_'))); }
/// <summary> /// /// </summary> /// <param name="callback"></param> /// <param name="textruename"></param>加载图片的路径名字 public void Show(EventDelegate callback) { InLoading = true; BeginHide = false; //gameObject.SetActive(true); loadingType = LoadingType.FadeOut; curCallBack = callback; FadeOutTexture.mainTexture = Resources.Load(StringBuilderTool.ToInfoString("BackGround/", LoadingPicName)) as Texture; FadeOutRoot.SetActive(true); iTween.ValueTo(gameObject, iTween.Hash( "name", "FadeOut", "from", 0f, "to", 1f, "easetype", iTween.EaseType.easeInOutCubic, "loopType", iTween.LoopType.none, "onupdate", "ChangeFadeOutPlaneAlpha", "oncomplete", "ShowOver", "time", LoadingConsuming * 1.5f)); StartCoroutine("RunShowLoadingPoint"); ProgressBar.value = 0; }
void OnTriggerEnter(Collider collider) { if (GameApp.Instance.FightUI == null) { return; } if (!GameApp.Instance.FightUI.GameBegin) { return; } if (collider.name.IndexOf("Player_") == 0) { #if UNITY_EDITOR Debug.Log(StringBuilderTool.ToInfoString("Trigger: ", gameObject.name, "与", collider.name, " 接触! 类型:", EventType.ToString())); #endif switch (EventType) { case EEventType.eStart: { GameApp.Instance.FightUI.ShowBeginPointHint(); } break; case EEventType.eToBoss: { GameApp.Instance.FightUI.ShowGotoBossHint(); } break; } } }
/*public void OnClick_CompoundByMagicPower() * { * GameApp.Instance.SoundInstance.PlaySe("button"); * * GameApp.Instance.CommonMsgDlg.OpenMsgBox(StringBuilderTool.ToString("是否消耗", OutputCard.MCCfg.NeedCurrencyItemInfo.ItemCnt, "点魔力值合成", OutputCard.FullName(), "?"), * (isCompound) => * { * if (isCompound) * { * if (GameApp.Instance.MainPlayerData.MagicPower >= OutputCard.MCCfg.NeedCurrencyItemInfo.ItemCnt) * { * GameApp.Instance.MainPlayerData.MagicPower -= OutputCard.MCCfg.NeedCurrencyItemInfo.ItemCnt; * * GameApp.Instance.AddCardHoldCount(OutputCard.MCCfg.CardID, 1); * * CompoundSuccess(); * } * else * { * GameApp.Instance.CommonMsgDlg.OpenMsgBox("魔力值不足!"); * } * } * }); * }*/ public void OnClick_CompoundByCard() { GameApp.Instance.SoundInstance.PlaySe("button"); GameApp.Instance.CommonMsgDlg.OpenMsgBox(StringBuilderTool.ToString("是否消耗", OutputCard.MCCfg.NeedItemsLst.Count, "张材料卡牌合成", OutputCard.FullName(), "?"), (isCompound) => { if (isCompound) { if (GameApp.Instance.PlayerData != null) { GameApp.SendMsg.Compose(common.ComposeType.ComposeType_Item, (uint)OutputCard.MCCfg.CardID); } else { GameApp.Instance.AddCardHoldCount(OutputCard.MCCfg.CardID, 1); for (int i = 0; i < OutputCard.MCCfg.NeedItemsLst.Count; i++) { if (i < MaterialCards.Length) { GameApp.Instance.AddCardHoldCount(OutputCard.MCCfg.NeedItemsLst[i].ItemID, -1); } } CompoundSuccess(OutputCard.MCCfg.CardID); } } }); }
public void UpdateModifyTime() { LastModifyTime = StringBuilderTool.ToInfoString( "最后修改时间:", DateTime.Now.ToString(), "\n修改者名称:", SystemInfo.deviceName, "\n修改者IP地址:", MyTools.GetIPAddress()); }
public void Set(FriendInfo fi) { CurFI = fi; Name.text = CurFI.Name; int RoleID = Math.Max(fi.RoleID, 1); RoleConfig rc = null; if (CsvConfigTables.Instance.RoleCsvDic.TryGetValue(RoleID, out rc)) { HeadPortrait.spriteName = rc.Portrait; } StageConfig sc = null; CsvConfigTables.Instance.StageCsvDic.TryGetValue(CurFI.StageProgress, out sc); if (sc != null) { ChapterConfig cc = null; CsvConfigTables.Instance.ChapterCsvDic.TryGetValue(sc.ChapterID, out cc); GroupConfig gc = null; CsvConfigTables.Instance.GroupCsvDic.TryGetValue(sc.GroupID, out gc); if (cc != null && gc != null) { Stage.text = StringBuilderTool.ToInfoString(cc.Name, "-", gc.Name, "-", sc.Name); } } }
/// <summary> 监测使用时长 </summary> static public void CheckUseDuration() { float d = 0; switch (SleepInfo.SleepInfoInstance.EnableUseDuration) { case EDuration.e15Minute: d = 15 * 60; break; case EDuration.e30Minute: d = 30 * 60; break; case EDuration.e45Minute: d = 45 * 60; break; case EDuration.e60Minute: d = 60 * 60; break; } if (Time.realtimeSinceStartup > d) { if (GameApp.Instance.HomePageUI != null) { GameApp.Instance.CommonWarningDlg.OpenWarningBox(StringBuilderTool.ToString("本次使用时长已超出设置时长(", d / 60, "分钟)")); } } }
public void PlaySeAndFadeBgm(string seName) { AudioClip clip = Resources.Load(StringBuilderTool.ToInfoString("Sound/Se/", seName)) as AudioClip; int track = ChooseFreeSeTrack(); m_TrackSEList[track].clip = clip; m_TrackSEList[track].loop = false; m_TrackSEList[track].Play(); m_FadeBgmSeTrk = track; if (clip.length < 0.5f) { //no fade bgm, cause se is too short if (IsBgmPlaying()) { m_TrackBgm[m_ActiveBgmTrack].volume = (float)(m_CurrentBgmVol / 300.0f); } } else { if (IsBgmPlaying()) { TweenVolume.Begin(m_TrackBgm[m_ActiveBgmTrack].gameObject, 0.2f, (float)m_CurrentBgmVol / 300.0f); } } m_Status = E_SND_STAT.STAT_SE_FADE_BGM; }
public void OnClick_Get() { GameApp.Instance.SoundInstance.PlaySe("button"); GameApp.Instance.GetItemsDlg.OpenGetItemsBox(AwardItemDic); GetBtn.isEnabled = false; GetBtnText.text = "已领取"; foreach (KeyValuePair <int, int> pair in AwardItemDic) { GameApp.SendMsg.GMOrder(StringBuilderTool.ToString("AddItem ", pair.Key, " ", pair.Value)); } string IsGetStateKey = StringBuilderTool.ToString(SerPlayerData.GetAccountID(), "_AccumulativeLogin_IsGetState"); if (PlayerPrefs.HasKey(IsGetStateKey)) { string OldState = PlayerPrefs.GetString(IsGetStateKey); OldState += StringBuilderTool.ToString("_", CurIndex); PlayerPrefs.SetString(IsGetStateKey, OldState); } else { PlayerPrefs.SetString(IsGetStateKey, CurIndex.ToString()); } }
public void OnClick_Package_Grid(GameObject btnObj) { GameApp.Instance.SoundInstance.PlaySe("button"); Debug.Log(StringBuilderTool.ToInfoString("点击【背包-格子】", btnObj.name)); CurTypeGrids.Clear(); switch (btnObj.name) { case "Grid_Package_Food": CurTypeGrids.Add(btnObj); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Food1").gameObject); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Food2").gameObject); ShowItemLst(ETravelBackpackItemType.eFood, btnObj); break; case "Grid_Package_Lucky": CurTypeGrids.Add(btnObj); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Lucky1").gameObject); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Lucky2").gameObject); ShowItemLst(ETravelBackpackItemType.eLucky, btnObj); break; case "Grid_Package_Equipment1": case "Grid_Package_Equipment2": CurTypeGrids.Add(PackageRoot.transform.Find("Grid_Package_Equipment1").gameObject); CurTypeGrids.Add(PackageRoot.transform.Find("Grid_Package_Equipment2").gameObject); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Equipment1").gameObject); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Equipment2").gameObject); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Equipment3").gameObject); CurTypeGrids.Add(PrepareRoot.transform.Find("Grid_Prepare_Equipment4").gameObject); ShowItemLst(ETravelBackpackItemType.eEquipment, btnObj); break; } }
public void RecoverFromPurchased() { Price.text = StringBuilderTool.ToString("[FFFB63]", PriceValue, "[-]"); Price.transform.localPosition = new Vector3(-10, -122, 0); transform.Find("PriceIcon").gameObject.SetActive(true); transform.Find("Bg").GetComponent <UISprite>().spriteName = "lankuang"; PurchasedSign.SetActive(false); }
public void WeChatLogin(string unionid, string openid, string accessToken) { GameApp.SendMsg.StartWaitUI(); GameApp.Instance.WaitLoadHintDlg.OpenHintBox("正在登录游戏平台..."); HttpLinkGet(StringBuilderTool.AppendFormat(GetPlatformURL(EPlatformFunType.eWeChatLogin), unionid, openid, accessToken)); StartCoroutine("WaitToLogin"); }
public void PhoneNumLoginUseVerificationCode(string PhoneNum, string VerificationCode) { GameApp.SendMsg.StartWaitUI(); GameApp.Instance.WaitLoadHintDlg.OpenHintBox("正在使用手机号登录..."); HttpLinkGet(StringBuilderTool.AppendFormat(GetPlatformURL(EPlatformFunType.ePhoneNumLoginUseVerificationCode), PhoneNum, VerificationCode)); StartCoroutine("WaitToLogin"); }
private void LstDataToString() { TaskInfo = StringBuilderTool.ToString(TempValue1, "#", TempValue2); #if UNITY_EDITOR Debug.Log("最新任务数据:"); Debug.Log(TaskInfo); #endif }
/// <summary> 创建账号服连接 </summary> /*public void CreateUserServerSocket() * { #if UNITY_EDITOR * Debug.Log(StringBuilderTool.ToString("连接账号服 IP:", Const.AccountServerIP, " 端口:", Const.AccountServerPort)); #endif * GameApp.SocketClient_User = SocketClient.SocketConnect(Const.AccountServerIP, Const.AccountServerPort, "SocketClient_User"); * }*/ /// <summary> 登录 </summary> /*public void Login(string account, string password) * { * Msg_Client2Account_Login_Req login = new Msg_Client2Account_Login_Req(); * login.m_account_name = account; * login.m_account_key = password; #if UNITY_EDITOR * Debug.Log(StringBuilderTool.ToString("账号:", login.m_account_name, " 密码:", login.m_account_key)); #endif * Send<Msg_Client2Account_Login_Req>(login, GameApp.SocketClient_User, (int)MsgType.enum_Msg_Client2Account_Login_Req); * }*/ /// <summary> 创建游戏服连接 </summary> public void CreateGameServerSocket() { #if UNITY_EDITOR Const.GameServerIP = "58.246.123.230";//编辑器模式下连接测试服务器 #endif Debug.Log(StringBuilderTool.ToString("连接游戏服 IP:", Const.GameServerIP, " 端口:", Const.GameServerPort)); GameApp.SocketClient_Game = SocketClient.SocketConnect(Const.GameServerIP, Const.GameServerPort, "SocketClient_Game"); }
public SleepInfo() { uint AccountID = SerPlayerData.GetAccountID(); key_SleepBeginTime = StringBuilderTool.ToString(AccountID, "_PetInfo_SleepBeginTime"); key_SleepEndTime = StringBuilderTool.ToString(AccountID, "_PetInfo_key_SleepEndTime"); key_EnableUseDuration = StringBuilderTool.ToString(AccountID, "_PetInfo_EnableUseDuration"); key_RestUseDuration = StringBuilderTool.ToString(AccountID, "_PetInfo_RestUseDuration"); }
public void Show(bool isShow) { if (isShow) { gameObject.SetActive(true); AppearEffect.transform.localScale = Vector3.one * 0.01f; AppearEffect.Open(AppearType.Popup, AppearEffect.gameObject); GameApp.Instance.UICurrency.Show(true); //AddMail(1531209933, "新手奖励","欢迎加入魔卡百科的世界,为了让你更快的学习知识,我们为你准备了一些补给。"); //AddMail(1531209934, "一封假邮件","一封本不该出现在这里的邮件,仅供测试。"); if (LstGrid.transform.childCount == 0) { int i = 0; foreach (KeyValuePair <uint, MailItemInfo> pair in GameApp.Instance.MailItemsDic) { GameObject newUnit = NGUITools.AddChild(LstGrid, MailItemUnitPrefab); newUnit.SetActive(true); newUnit.name = "MailItemUnit_" + (i++); newUnit.GetComponent <UI_MailItemUnit>().Set(pair.Value); } LstGrid.transform.GetComponent <UIGrid>().repositionNow = true; LstGrid.transform.parent.GetComponent <UIScrollView>().ResetPosition(); } int MailCount = LstGrid.transform.childCount; MailCnt.text = StringBuilderTool.ToString("邮件数:" + MailCount); if (MailCount == 0) { NoMailHintRoot.SetActive(true); MailLstRoot.SetActive(false); DetailsRoot.SetActive(false); } else { NoMailHintRoot.SetActive(false); MailLstRoot.SetActive(true); DetailsRoot.SetActive(true); } InvokeRepeating("UpdateMailRedPoint", 0, 1f); } else { GameApp.Instance.UICurrency.Show(false); AppearEffect.Close(AppearType.Popup, () => { gameObject.SetActive(false); }); } }