public static IGameLanguage GetLang(LangEnum langEnum) { IGameLanguage lang = null; if (!_langTable.ContainsKey(langEnum)) { lock (thisLock) { if (!_langTable.ContainsKey(langEnum)) { switch (langEnum) { case LangEnum.ZH_CN: _langTable.Add(langEnum, new GameZHLanguage()); break; case LangEnum.BIG5_TW: //_langTable.Add(langEnum, new GameBig5Language()); break; case LangEnum.EN_US: //_langTable.Add(langEnum, new GameZHLanguage()); break; default: throw new Exception("Language is error."); } } } } lang = _langTable[langEnum]; return(lang); }
public static void UserShengJiTaRank() { Ranking <UserRank> rankList = RankingFactory.Get <UserRank>(ShengJiTaRanking.RankingKey); if (rankList != null) { if (DateTime.Now.Hour == 0) { foreach (UserRank userRank in rankList) { GameUser usergame = new PersonalCacheStruct <GameUser>().FindKey(userRank.UserID); if (usergame != null && userRank.ScoreStar > 0) { // 信件通知玩家 “您在XX-XX的“勇闯圣吉塔”活动中名列XX榜第N,排名奖励M金币已经发送到您的账号中,请及时查收!” TjxMailService mailService = new TjxMailService(usergame); var mail = new UserMail(Guid.NewGuid()); mail.UserId = userRank.UserID.ToInt(); mail.MailType = (int)MailType.System; mail.ToUserID = userRank.UserID.ToInt(); mail.FromUserName = LanguageManager.GetLang().St_SystemMailTitle; mail.Title = LanguageManager.GetLang().St_SystemMailTitle; mail.SendDate = DateTime.Now; IGameLanguage gameLanguage = LanguageManager.GetLang(); SJTRankRewarInfo SJTRankRewar = new ShareCacheStruct <SJTRankRewarInfo>().FindKey(userRank.SJTRankId, userRank.SJTRankType.ToInt()); if (SJTRankRewar != null) { if (usergame.UserLv >= 10 && usergame.UserLv < 30) { usergame.GameCoin = usergame.GameCoin + SJTRankRewar.GiftGold; mail.Content = String.Format(gameLanguage.St_ShengJiTaTip, DateTime.Now.ToString("MM-dd"), gameLanguage.St_ShengJiTaQintTong, userRank.SJTRankId, SJTRankRewar.GiftGold); } if (usergame.UserLv >= 30 && usergame.UserLv < 54) { usergame.GameCoin = usergame.GameCoin + SJTRankRewar.GiftGold; mail.Content = String.Format(gameLanguage.St_ShengJiTaTip, DateTime.Now.ToString("MM-dd"), gameLanguage.St_ShengJiTaBaiYin, userRank.SJTRankId, SJTRankRewar.GiftGold); } if (usergame.UserLv >= 55) { usergame.GameCoin = usergame.GameCoin + SJTRankRewar.GiftGold; mail.Content = String.Format(gameLanguage.St_ShengJiTaTip, DateTime.Now.ToString("MM-dd"), gameLanguage.St_ShengJiTaHuangJin, userRank.SJTRankId, SJTRankRewar.GiftGold); } mailService.Send(mail); } } } } } }
// Start is called before the first frame update private void Start() { env = new LuaEnv(); env.DoString("require 'CallLua'"); IGameLanguage gl = env.Global.Get <IGameLanguage>("gameLanguage"); Debug.Log("interface--" + gl.str1); Debug.Log("interface--" + gl.str2); //interface是引用拷贝 gl.str1 = "copy"; //lua输出 env.DoString("print('引用拷贝' .. gameLanguage.str1)"); }