IEnumerator LoadingImage(string url, UITexture texture, string filePath) { WWW www = new WWW(url); yield return(www); if (www.error == null && www.isDone) { Texture2D temp = new Texture2D(0, 0, TextureFormat.ARGB4444, false); www.LoadImageIntoTexture(temp); texture.mainTexture = temp; texture.color = new Color(1f, 1f, 1f, 1f); www.Dispose(); byte[] bytes = UtilMgr.IsMLB() ? temp.EncodeToPNG() : temp.EncodeToJPG(); try{ File.WriteAllBytes(filePath, bytes); if (bytes.Length < 10) { throw new Exception("file size is zero"); } } catch { File.Delete(filePath); // Debug.Log("file deleted : "+filePath); } // Debug.Log("save image : " + filePath); } }
/**마켓 결제용*/ public void InitGoldShop(string title, int category, GetGoldShopEvent goldEvent) { mGoldList = goldEvent.Response.data; transform.FindChild("Top").FindChild("LblShop").GetComponent <UILabel>().text = title; mCategory = category; InitGoldList(); if (Application.platform == RuntimePlatform.IPhonePlayer) { IOSMgr.InAppInit(); } else if (Application.platform == RuntimePlatform.Android) { #if (UNITY_ANDROID) if (UtilMgr.IsMLB()) { GoogleIAB.init(Constants.GOOGLE_PUBLIC_KEY_MLB); } else { GoogleIAB.init(Constants.GOOGLE_PUBLIC_KEY_KBO); } #endif } }
public void Init(ContestListInfo contest) { mContest = contest; string startTime = ""; if (UtilMgr.IsMLB()) { startTime = mContest.startTime; } else { startTime = mContest.korStartTime; } int year = int.Parse(startTime.Substring(0, 4)); int mon = int.Parse(startTime.Substring(4, 2)); int day = int.Parse(startTime.Substring(6, 2)); int hour = int.Parse(startTime.Substring(8, 2)); int min = int.Parse(startTime.Substring(10, 2)); int sec = int.Parse(startTime.Substring(12, 2)); mContestTime = new DateTime(year, mon, day, hour, min, sec); transform.localPosition = new Vector3(2000f, 2000f, 0); transform.gameObject.SetActive(true); mEntryEvent = new EntryListEvent(ReceivedEntry); NetMgr.EntryList(mContest.contestSeq, mEntryEvent); }
public void Set(SkillsetInfo skill) { mInfo = skill; transform.FindChild("LblName").gameObject.SetActive(true); transform.FindChild("LblLv").gameObject.SetActive(true); transform.FindChild("LblAddPoint").gameObject.SetActive(true); transform.FindChild("SprIcon").gameObject.SetActive(true); transform.FindChild("LblDesc").gameObject.SetActive(true); transform.FindChild("SprEmpty").gameObject.SetActive(false); transform.FindChild("LblEmpty").gameObject.SetActive(false); transform.FindChild("Button").FindChild("SprPlus").gameObject.SetActive(false); transform.FindChild("Button").FindChild("SprUnlock").gameObject.SetActive(true); transform.FindChild("SprIcon").GetComponent <UISprite>().spriteName = "skill_icon_bg_" + skill.itemClass; transform.FindChild("SprIcon").FindChild("Icon").GetComponent <UISprite>().spriteName = SkillsetInfo.GetSkillImgDic()[skill.itemCode]; transform.FindChild("SprIcon").FindChild("Level").GetComponent <UISprite>().spriteName = "skill_icon_lv_" + skill.itemLevel; transform.FindChild("LblLv").FindChild("Label").GetComponent <UILabel>().text = skill.itemClass + ""; transform.FindChild("LblAddPoint").FindChild("Label").GetComponent <UILabel>().text = skill.addPoint; transform.FindChild("LblName").GetComponent <UILabel>().text = UtilMgr.IsMLB() ? skill.itemName : Localization.language.Equals("English") ? skill.itemName : skill.itemNameKor; transform.FindChild("LblDesc").GetComponent <UILabel>().text = UtilMgr.IsMLB() ? skill.itemDesc : Localization.language.Equals("English") ? skill.itemDesc : skill.itemDescKor; }
void InitNewType() { if (IsCard) { if (UtilMgr.IsMLB()) { transform.FindChild("Body").FindChild("SelectionForCard").FindChild("BtnCard") .GetComponent <PlayerCardSelectionBtns>().SetCard(); } else { transform.FindChild("Body").FindChild("SelectionForCardKBO").FindChild("BtnCard") .GetComponent <PlayerCardSelectionBtns>().SetCard(); } } else { if (UtilMgr.IsMLB()) { transform.FindChild("Body").FindChild("SelectionForPlayer").FindChild("BtnGameLog") .GetComponent <PlayerCardSelectionBtns>().SetGameLog(); } else { transform.FindChild("Body").FindChild("SelectionForPlayerKBO").FindChild("BtnGameLog") .GetComponent <PlayerCardSelectionBtns>().SetGameLog(); } } }
public void OnClick() { int positionNo = transform.root.FindChild("SkillList").GetComponent <SkillList>().mCardInfo.positionNo; if (positionNo == 1) { if (mInfo.position == 1) { DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("StrError"), UtilMgr.GetLocalText("StrPosError"), DialogueMgr.DIALOGUE_TYPE.Alert, null); return; } } else { if (mInfo.position == 2) { DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("StrError"), UtilMgr.GetLocalText("StrPosError"), DialogueMgr.DIALOGUE_TYPE.Alert, null); return; } } string name = UtilMgr.IsMLB() ? mInfo.itemName : Localization.language.Equals("English") ? mInfo.itemName : mInfo.itemNameKor; DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("LblSkillset"), string.Format(UtilMgr.GetLocalText("StrSetSkill"), name), DialogueMgr.DIALOGUE_TYPE.YesNo, DiagHandler); }
// Use this for initialization new void Start() { base.Start(); if (UtilMgr.IsMLB()) { transform.FindChild("SprTitle").FindChild("SprK").gameObject.SetActive(false); } else { transform.FindChild("SprTitle").FindChild("SprK").gameObject.SetActive(true); } transform.FindChild("Terms").gameObject.SetActive(false); transform.FindChild("RegisterUsername").gameObject.SetActive(false); transform.FindChild("RegisterUsername").localPosition = new Vector3(0f, UtilMgr.GetScaledPositionY()); // if(UtilMgr.IsMLB()) // transform.FindChild("SprTitle").GetComponent<UISprite>().spriteName = "logo_title1"; if (mNick != null) { Debug.Log("Nick is " + mNick); Login(); return; } mVersionEvent = new CheckVersionEvent(new EventDelegate(ReceivedVersion)); // transform.FindChild("Terms").GetComponent<Terms>().Init(); NetMgr.CheckVersion(mVersionEvent, false); }
// Update is called once per frame void Update() { if (mContest == null) { return; } if (mContest.contestStatus == ContestListInfo.STATUS_UP) { if (mContestTime.Year < 2016) { return; } if (UtilMgr.IsMLB()) { TimeSpan ts = mContestTime.AddHours(13d) - DateTime.Now.AddTicks(UserMgr.DiffTicks); transform.FindChild("InfoTop").FindChild("Time").FindChild("LblRight").GetComponent <UILabel>().text = UtilMgr.GetDateTime(ts); } else { TimeSpan ts = mContestTime - DateTime.Now.AddTicks(UserMgr.DiffTicks); transform.FindChild("InfoTop").FindChild("Time").FindChild("LblRight").GetComponent <UILabel>().text = UtilMgr.GetDateTime(ts); } } }
public void InitWithCard(CardInfo cardInfo, Texture photo) { mPhoto = photo; IsCard = true; mCardInfo = cardInfo; if (UtilMgr.IsMLB()) { transform.FindChild("Body").FindChild("Info").FindChild("KBO").FindChild("Panel").FindChild("Photo") .GetComponent <UITexture>().width = 135; transform.FindChild("Body").FindChild("Info").FindChild("KBO").FindChild("Panel").FindChild("Photo") .GetComponent <UITexture>().height = 180; transform.FindChild("Body").FindChild("SelectionForPlayer").gameObject.SetActive(false); transform.FindChild("Body").FindChild("SelectionForPlayerKBO").gameObject.SetActive(false); transform.FindChild("Body").FindChild("SelectionForCard").gameObject.SetActive(true); transform.FindChild("Body").FindChild("SelectionForCardKBO").gameObject.SetActive(false); } else { transform.FindChild("Body").FindChild("SelectionForPlayer").gameObject.SetActive(false); transform.FindChild("Body").FindChild("SelectionForPlayerKBO").gameObject.SetActive(false); transform.FindChild("Body").FindChild("SelectionForCard").gameObject.SetActive(false); transform.FindChild("Body").FindChild("SelectionForCardKBO").gameObject.SetActive(true); } mPlayerId = cardInfo.playerFK; CommonInit(); }
void SetNotReady() { IsNotReady = true; // dateTime: "20160426053000", string dateTime = UtilMgr.IsMLB() ? UserMgr.eventJoined.dateTime : UserMgr.eventJoined.korDateTime; string timeZone = UtilMgr.IsMLB() ? "ET" : "KST"; int month = int.Parse(dateTime.Substring(4, 2)); int date = int.Parse(dateTime.Substring(6, 2)); int hour = int.Parse(dateTime.Substring(8, 2)); string min = dateTime.Substring(10, 2); string strTime = Localization.language.Equals("English") ? UtilMgr.GetMonthString(month) + " " + date + ", " + timeZone + " " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1] : month + "월 " + date + "일, " + timeZone + " " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1]; transform.FindChild("Body").FindChild("Scroll View").FindChild("Board").FindChild("Sprite") .FindChild("NotReady").FindChild("Label1").GetComponent <UILabel>().text = string.Format(UtilMgr.GetLocalText("StrBingoSub1"), strTime); transform.FindChild("Body").FindChild("Scroll View").FindChild("Board").FindChild("Sprite") .FindChild("NotReady").FindChild("Label2").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrBingoSub2"); transform.FindChild("Body").FindChild("Scroll View").FindChild("Board").FindChild("Sprite") .FindChild("NotReady").gameObject.SetActive(true); Transform score = transform.FindChild("Top").FindChild("Score"); score.FindChild("AwayScore").GetComponent <UILabel>().text = "0"; score.FindChild("HomeScore").GetComponent <UILabel>().text = "0"; score.FindChild("AwayName").GetComponent <UILabel>().text = UserMgr.eventJoined.awayTeam; score.FindChild("HomeName").GetComponent <UILabel>().text = UserMgr.eventJoined.homeTeam; score.FindChild("AwayName").FindChild("Sprite").gameObject.SetActive(false); score.FindChild("HomeName").FindChild("Sprite").gameObject.SetActive(false); Transform btm = transform.FindChild("Body").FindChild("Scroll View").FindChild("Btm"); btm.FindChild("Info").FindChild("BG").FindChild("LblRound").GetComponent <UILabel>() .text = ""; btm.FindChild("Info").FindChild("BG").FindChild("LblName").FindChild("Label").GetComponent <UILabel>() .text = ""; btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>() .text = ""; btm.FindChild("Info").FindChild("SprCircle").FindChild("Hand").FindChild("Label").GetComponent <UILabel>() .text = ""; transform.FindChild("Body").FindChild("Scroll View").FindChild("Board").FindChild("BtnBingo").FindChild("Sprite") .gameObject.SetActive(false); transform.FindChild("Body").FindChild("Scroll View").FindChild("Board").FindChild("BtnBingo") .GetComponent <UIButton>().isEnabled = false; DisableResetBtn(); btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().RemoveAll(); ShowNext(); }
void InitGames() { Transform tf = transform.FindChild("Changeables").FindChild("Games"); tf.gameObject.SetActive(true); UtilMgr.ClearList(tf.FindChild("Draggable")); tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().Init(mTeamEvent.Response.data.Count, delegate(UIListItem item, int index) { item.Target.transform.FindChild("SprLeft").FindChild("Label").GetComponent <UILabel>() .text = mTeamEvent.Response.data[index].awayTeamRuns + ""; item.Target.transform.FindChild("SprRight").FindChild("Label").GetComponent <UILabel>() .text = mTeamEvent.Response.data[index].homeTeamRuns + ""; item.Target.transform.FindChild("SprLeft").FindChild("SprEmblem").GetComponent <UISprite>() .spriteName = mTeamEvent.Response.data[index].awayTeamId + ""; item.Target.transform.FindChild("SprRight").FindChild("SprEmblem").GetComponent <UISprite>() .spriteName = mTeamEvent.Response.data[index].homeTeamId + ""; if (!UtilMgr.IsMLB()) { item.Target.transform.FindChild("SprLeft").FindChild("SprEmblem").GetComponent <UISprite>().width = 74; item.Target.transform.FindChild("SprLeft").FindChild("SprEmblem").GetComponent <UISprite>().height = 60; item.Target.transform.FindChild("SprRight").FindChild("SprEmblem").GetComponent <UISprite>().width = 74; item.Target.transform.FindChild("SprRight").FindChild("SprEmblem").GetComponent <UISprite>().height = 60; } item.Target.transform.FindChild("LblCenter").GetComponent <UILabel>() .text = mTeamEvent.Response.data[index].awayTeam + " " + mTeamEvent.Response.data[index].homeTeam; int hour = int.Parse(mTeamEvent.Response.data[index].dateTime.Substring(8, 2)); string min = mTeamEvent.Response.data[index].dateTime.Substring(10, 2); //20160326220500 if (UtilMgr.IsMLB()) { item.Target.transform.FindChild("LblCenter").FindChild("LblUnder").GetComponent <UILabel>() .text = mTeamEvent.Response.data[index].day + " ET " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1]; } else { if (Localization.language.Equals("English")) { item.Target.transform.FindChild("LblCenter").FindChild("LblUnder").GetComponent <UILabel>() .text = mTeamEvent.Response.data[index].day + " KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1]; } else { item.Target.transform.FindChild("LblCenter").FindChild("LblUnder").GetComponent <UILabel>() .text = "KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " (" + UtilMgr.GetAMPM(hour)[1] + UtilMgr.DayToKorean(mTeamEvent.Response.data[index].day) + ")"; } } }); tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition(); }
public void InitRegisterEntry(ContestListInfo contestInfo) { // mContestSeq = contestSeq; mContestInfo = contestInfo; string startTime = null; if (UtilMgr.IsMLB()) { startTime = mContestInfo.startTime; } else { startTime = mContestInfo.korStartTime; } int year = 0, mon = 0, day = 0, hour = 0, min = 0, sec = 0; // if(mContestInfo.startTime == null || mContestInfo.startTime.Length < 13){ // mContestTime = new DateTime(2016, 1, 1, 1, 1, 1); // } else{ year = int.Parse(startTime.Substring(0, 4)); mon = int.Parse(startTime.Substring(4, 2)); day = int.Parse(startTime.Substring(6, 2)); hour = int.Parse(startTime.Substring(8, 2)); min = int.Parse(startTime.Substring(10, 2)); sec = int.Parse(startTime.Substring(12, 2)); // } mContestTime = new DateTime(year, mon, day, hour, min, sec); string strMin = "" + min; if (min < 10) { strMin = "0" + min; } if (UtilMgr.IsMLB()) { transform.FindChild("InfoTop").FindChild("Time").FindChild("LblLeft").GetComponent <UILabel>().text = "ET " + UtilMgr.GetAMPM(hour)[0] + ":" + strMin + " " + UtilMgr.GetAMPM(hour)[1] + " " + UtilMgr.GetLocalText("StrStart"); } else { transform.FindChild("InfoTop").FindChild("Time").FindChild("LblLeft").GetComponent <UILabel>().text = "KST " + UtilMgr.GetAMPM(hour)[0] + ":" + strMin + " " + UtilMgr.GetAMPM(hour)[1] + " " + UtilMgr.GetLocalText("StrStart"); } Initialize(); }
public void DialogueClickHandler(DialogueMgr.BTNS btn) { if (mMustUpdate) { if (btn == DialogueMgr.BTNS.Btn1) { Debug.Log("Go to Store"); #if (UNITY_ANDROID) if (UtilMgr.IsMLB()) { Application.OpenURL(Constants.STORE_GOOGLE_MLB); } else { Application.OpenURL(Constants.STORE_GOOGLE_KBO); } #else Application.OpenURL(Constants.STORE_IPHONE); #endif } else { UtilMgr.Quit(); } } else { if (btn == DialogueMgr.BTNS.Btn1) { Debug.Log("Go to Store"); #if (UNITY_ANDROID) if (UtilMgr.IsMLB()) { Application.OpenURL(Constants.STORE_GOOGLE_MLB); } else { Application.OpenURL(Constants.STORE_GOOGLE_KBO); } #else Application.OpenURL(Constants.STORE_IPHONE); #endif } else { CheckPreference(); } } }
// Use this for initialization void Start() { Texture2D texture = null; if (UtilMgr.IsMLB()) { texture = Resources.Load <Texture2D>("images/rt_bingo_comingsoon"); } else { texture = Resources.Load <Texture2D>("images/rt_bingo_comingsoon_k"); } transform.FindChild("Body").FindChild("Scroll View").GetChild(0).GetComponent <UITexture>().mainTexture = texture; }
void SetTileTeam() { transform.FindChild("Player").gameObject.SetActive(false); transform.FindChild("Team").gameObject.SetActive(true); if (!UtilMgr.IsMLB()) { transform.FindChild("Team").FindChild("SprEmblem").GetComponent <UISprite>().width = 74; transform.FindChild("Team").FindChild("SprEmblem").GetComponent <UISprite>().height = 60; } transform.FindChild("Team").FindChild("SprEmblem").GetComponent <UISprite>().spriteName = mBingoBoard.teamId + ""; transform.FindChild("Team").FindChild("LblName").GetComponent <UILabel>().text = Localization.language.Equals("English") ? mBingoBoard.teamName : mBingoBoard.teamKorName; transform.FindChild("Team").FindChild("LblGuess").GetComponent <UILabel>().text = Localization.language.Equals("English") ? mBingoBoard.quizCondition : mBingoBoard.quizConditionKor; }
public void OnClick() { int slot = int.Parse(transform.name.Substring(transform.name.Length - 1, 1)); if (mInfo == null) { transform.root.FindChild("SkillList").GetComponent <SkillList>().Init( transform.root.FindChild("PlayerCard").GetComponent <PlayerCard>().mCardInfo, slot); transform.root.FindChild("PlayerCard").gameObject.SetActive(false); return; } string name = UtilMgr.IsMLB() ? mInfo.itemName : Localization.language.Equals("English") ? mInfo.itemName : mInfo.itemNameKor; DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("LblSkillset"), string.Format(UtilMgr.GetLocalText("StrOffSkill"), name, 50), DialogueMgr.DIALOGUE_TYPE.YesNo, DiagHandler); }
static void LoadImage(string url, string versionNo, UITexture texture) { if (url == null || url.Length < 1) { return; } int pngIdx = url.LastIndexOf("."); int slashIdx = url.LastIndexOf("/", pngIdx); int length = pngIdx - slashIdx; string fileName = url.Substring(slashIdx, length); // Debug.Log("pngIdx : "+pngIdx+", slashIdx : "+slashIdx); string filePath = ""; if (UtilMgr.IsMLB()) { filePath = Application.temporaryCachePath + "/" + fileName + versionNo + ".png"; } else { filePath = Application.temporaryCachePath + "/" + fileName + versionNo + ".jpg"; } if (File.Exists(filePath)) { // Debug.Log("have image : " + filePath); FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); if (fs.Length < 10) { File.Delete(filePath); Instance.StartCoroutine(Instance.LoadingImage(url, texture, filePath)); } byte[] bytes = new byte[fs.Length]; fs.Read(bytes, 0, (int)fs.Length); Texture2D temp = new Texture2D(0, 0, TextureFormat.ARGB4444, false); temp.LoadImage(bytes); texture.mainTexture = temp; texture.color = new Color(1f, 1f, 1f, 1f); } else { Instance.StartCoroutine(Instance.LoadingImage(url, texture, filePath)); } }
public void OnBtnRightClick() { if (mCardInfo.useYn > 0) { DialogueMgr.ShowDialogue("InUse", "InUse", DialogueMgr.DIALOGUE_TYPE.Alert, null); return; } else if ((mCardInfo.cardClass >= CardInfo.CLASS_MAX) && (mCardInfo.cardLevel >= CardInfo.LEVEL_MAX)) { return; } else if (mCardInfo.cardLevel > 4) { if (UtilMgr.IsMLB()) { transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>() .Init(mCardInfo, transform.FindChild("MLB").FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture") .GetComponent <UITexture>().mainTexture, UtilMgr.GetLocalText("LblCardRankUp"), CardPowerUp.TYPE.RANKUP); } else { transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>() .Init(mCardInfo, transform.FindChild("KBO").FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture") .GetComponent <UITexture>().mainTexture, UtilMgr.GetLocalText("LblCardRankUp"), CardPowerUp.TYPE.RANKUP); } } else { if (UtilMgr.IsMLB()) { transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>() .Init(mCardInfo, transform.FindChild("MLB").FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture") .GetComponent <UITexture>().mainTexture, UtilMgr.GetLocalText("LblCardPowerUp"), CardPowerUp.TYPE.LEVELUP); } else { transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>() .Init(mCardInfo, transform.FindChild("KBO").FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture") .GetComponent <UITexture>().mainTexture, UtilMgr.GetLocalText("LblCardPowerUp"), CardPowerUp.TYPE.LEVELUP); } } UtilMgr.AddBackState(UtilMgr.STATE.CardPowerUp); UtilMgr.AnimatePageToLeft("MyCards", "CardPowerUp"); }
private void webAPIProcessEventForCheckVersion(BaseRequest request, BaseEvent baseEvent, bool isTest, bool showLoading) { string reqParam = ""; string httpUrl = ""; if (request != null) { reqParam = request.ToRequestString(); } else { } string host = ""; if (UtilMgr.IsMLB()) { host = Constants.CHECK_SERVER_HOST_MLB; } else { host = Constants.CHECK_SERVER_HOST_KBO; } // if(isTest){ // host = Constants.CHECK_TEST_SERVER_HOST; // Debug.Log("Send to Test Server"); // } else{ // Debug.Log("Send to Real Server"); // } // host = Constants.CHECK_TEST_SERVER_HOST; WWW www = new WWW(host, System.Text.Encoding.UTF8.GetBytes(reqParam)); mUrl = host; mReqParam = null; mForm = null; mReqParam = System.Text.Encoding.UTF8.GetBytes(reqParam); Debug.Log(host + "?" + reqParam); StartCoroutine(webAPIProcess(www, baseEvent, showLoading, false)); }
public void Init(SkillsetInfo info) { mInfo = info; transform.FindChild("BtnPhoto").FindChild("BG").GetComponent <UISprite>().spriteName = "skill_icon_bg_" + info.itemClass; transform.FindChild("BtnPhoto").FindChild("Icon").GetComponent <UISprite>().spriteName = SkillsetInfo.GetSkillImgDic()[info.itemCode]; transform.FindChild("BtnPhoto").FindChild("Grade").GetComponent <UISprite>().spriteName = "skill_icon_lv_" + info.itemLevel; transform.FindChild("LblTitle").GetComponent <UILabel>().text = UtilMgr.IsMLB() ? info.itemName : Localization.language.Equals("English") ? info.itemName : info.itemNameKor; transform.FindChild("LblDesc").GetComponent <UILabel>().text = UtilMgr.IsMLB() ? info.itemDesc : Localization.language.Equals("English") ? info.itemDesc : info.itemDescKor; }
void Awake() { TextAsset ta = Resources.Load("Liveball - sheet1", typeof(TextAsset)) as TextAsset; Localization.LoadCSV(ta); if (UtilMgr.IsMLB()) { Localization.language = "English"; return; } if (Application.systemLanguage == SystemLanguage.Korean) { Localization.language = "Korean"; } else { Localization.language = "English"; } }
void SetInfos() { InitPlayerInfo(); // if(IsInactive) return; InitGameLog(); InitAnalysis(); InitNews(); if (IsCard) { InitCardInfo(); if (UtilMgr.IsMLB()) { transform.FindChild("Body").FindChild("SelectionForCard").FindChild("BtnCard") .GetComponent <PlayerCardSelectionBtns>().SetCard(); } else { transform.FindChild("Body").FindChild("SelectionForCardKBO").FindChild("BtnCard") .GetComponent <PlayerCardSelectionBtns>().SetCard(); } } else { if (UtilMgr.IsMLB()) { transform.FindChild("Body").FindChild("SelectionForPlayer").FindChild("BtnGameLog") .GetComponent <PlayerCardSelectionBtns>().SetGameLog(); } else { transform.FindChild("Body").FindChild("SelectionForPlayerKBO").FindChild("BtnGameLog") .GetComponent <PlayerCardSelectionBtns>().SetGameLog(); } } // DisappearBack(); transform.GetComponent <PlayerCardAnimation>().CanOpen = true; }
// Update is called once per frame void Update() { // float listPos = transform.FindChild("Body").FindChild("List").FindChild("Scroll View").localPosition.y; // if(listPos < -1296f){ // SetScrollViewBody(); //// transform.FindChild("Body").FindChild("List").FindChild("Scroll View").localPosition = new Vector3(0, -1296f); // } else if(listPos > -446f){ // SetScrollViewBody(); //// transform.FindChild("Body").FindChild("List").FindChild("Scroll View").localPosition = new Vector3(0, -446); // } else{ // SetScrollViewList(); // } // if (mContestTime.Year < 2016) { return; } if (UtilMgr.IsMLB()) { TimeSpan ts = mContestTime.AddHours(13d) - DateTime.Now.AddTicks(UserMgr.DiffTicks); transform.FindChild("InfoTop").FindChild("Time").FindChild("LblRight").GetComponent <UILabel>().text = UtilMgr.GetDateTime(ts); } else { TimeSpan ts = mContestTime - DateTime.Now.AddTicks(UserMgr.DiffTicks); transform.FindChild("InfoTop").FindChild("Time").FindChild("LblRight").GetComponent <UILabel>().text = UtilMgr.GetDateTime(ts); } }
// IEnumerator WriteTimer(){ // System.DateTime now = System.DateTime.Now; // while(mStop){ // // } // // yield return 0; // } void ReceivedRT() { bool DonotDelete = false; if (mMatchCnt == mRTEvent.Response.data.Count) { DonotDelete = true; } if (!DonotDelete) { UtilMgr.ClearList(transform.FindChild("ScrollRT")); } float width = 720f; for (int i = 0; i < mRTEvent.Response.data.Count; i++) { Transform item = null; if (!DonotDelete) { item = Instantiate(mItemRT).transform; item.parent = transform.FindChild("ScrollRT"); item.localPosition = new Vector3(width * i, 1f, 1f); item.localScale = new Vector3(1f, 1f, 1f); item.name = "itemRTList_" + i; } else { item = transform.FindChild("ScrollRT").GetChild(i); } EventInfo data = mRTEvent.Response.data[i]; item.GetComponent <ItemRT>().mEventInfo = data; item.FindChild("Label").GetComponent <UILabel>().text = i + ""; if (i == 0) { item.FindChild("SprBG").FindChild("BtnLeft").GetComponent <BoxCollider2D>().size = Vector2.zero; item.FindChild("SprBG").FindChild("BtnLeft").FindChild("Background") .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f); item.FindChild("SprBG").FindChild("BtnLeft").FindChild("Background (1)") .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f); } else if (i == mRTEvent.Response.data.Count - 1) { item.FindChild("SprBG").FindChild("BtnRight").GetComponent <BoxCollider2D>().size = Vector2.zero; item.FindChild("SprBG").FindChild("BtnRight").FindChild("Background") .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f); item.FindChild("SprBG").FindChild("BtnRight").FindChild("Background (1)") .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f); } if (Localization.language.Equals("English")) { item.FindChild("Top").FindChild("LblStadium").GetComponent <UILabel>().text = data.stadiumName; } else { item.FindChild("Top").FindChild("LblStadium").GetComponent <UILabel>().text = data.korStadiumName; } item.FindChild("Top").FindChild("LblStadium").FindChild("Sprite").localPosition = new Vector3( -((((float)item.FindChild("Top").FindChild("LblStadium").GetComponent <UILabel>().width) / 2f) + 25f), 1f); item.FindChild("Score").FindChild("Left").FindChild("LblScore").GetComponent <UILabel>().text = data.awayTeamRuns + ""; item.FindChild("Score").FindChild("Right").FindChild("LblScore").GetComponent <UILabel>().text = data.homeTeamRuns + ""; item.FindChild("Score").FindChild("Left").FindChild("LblTeam").GetComponent <UILabel>().text = data.awayTeam; item.FindChild("Score").FindChild("Right").FindChild("LblTeam").GetComponent <UILabel>().text = data.homeTeam; item.FindChild("Score").FindChild("Left").FindChild("SprEmblem").GetComponent <UISprite>().spriteName = data.awayTeamId + ""; item.FindChild("Score").FindChild("Right").FindChild("SprEmblem").GetComponent <UISprite>().spriteName = data.homeTeamId + ""; if (!UtilMgr.IsMLB()) { item.FindChild("Score").FindChild("Left").FindChild("SprEmblem").GetComponent <UISprite>().width = 74; item.FindChild("Score").FindChild("Left").FindChild("SprEmblem").GetComponent <UISprite>().height = 60; item.FindChild("Score").FindChild("Right").FindChild("SprEmblem").GetComponent <UISprite>().width = 74; item.FindChild("Score").FindChild("Right").FindChild("SprEmblem").GetComponent <UISprite>().height = 60; } if (data.inningHalf.Equals("T")) { item.FindChild("Score").FindChild("Left").FindChild("SprStar").gameObject.SetActive(true); item.FindChild("Score").FindChild("Right").FindChild("SprStar").gameObject.SetActive(false); if (data.inning < 1) { item.FindChild("Players").GetComponent <UILabel>().text = ""; } else { if (Localization.language.Equals("English")) { item.FindChild("Players").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrTop") + " " + data.inning + UtilMgr.GetRoundString(data.inning); } else { item.FindChild("Players").GetComponent <UILabel>().text = data.inning + UtilMgr.GetRoundString(data.inning) + " " + UtilMgr.GetLocalText("StrTop"); } } item.FindChild("Players").FindChild("Left").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault(); item.FindChild("Players").FindChild("Left").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color = new Color(1f, 1f, 1f, 50f / 255f); // if(!UtilMgr.IsMLB()) item.FindChild("Players").FindChild("Left").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70; // UtilMgr.LoadImage(data.hitterPhoto, // item.FindChild("Players").FindChild("Left").FindChild("Frame") // .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>()); item.FindChild("Players").FindChild("Left") .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "B"; item.FindChild("Players").FindChild("Right").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault(); item.FindChild("Players").FindChild("Right").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color = new Color(1f, 1f, 1f, 50f / 255f); // if(!UtilMgr.IsMLB()) item.FindChild("Players").FindChild("Right").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70; // UtilMgr.LoadImage(data.pitcherPhoto, // item.FindChild("Players").FindChild("Right").FindChild("Frame") // .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>()); item.FindChild("Players").FindChild("Right") .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "P"; item.FindChild("Players").FindChild("Left") .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.hitterName; item.FindChild("Players").FindChild("Right") .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.pitcherName; } else { item.FindChild("Score").FindChild("Right").FindChild("SprStar").gameObject.SetActive(true); item.FindChild("Score").FindChild("Left").FindChild("SprStar").gameObject.SetActive(false); if (data.inning < 1) { item.FindChild("Players").GetComponent <UILabel>().text = ""; } else { if (Localization.language.Equals("English")) { item.FindChild("Players").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrBottom") + " " + data.inning + UtilMgr.GetRoundString(data.inning); } else { item.FindChild("Players").GetComponent <UILabel>().text = data.inning + UtilMgr.GetRoundString(data.inning) + " " + UtilMgr.GetLocalText("StrBottom"); } } item.FindChild("Players").FindChild("Left").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault(); item.FindChild("Players").FindChild("Left").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color = new Color(1f, 1f, 1f, 50f / 255f); // if(!UtilMgr.IsMLB()) item.FindChild("Players").FindChild("Left").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70; item.FindChild("Players").FindChild("Right").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault(); item.FindChild("Players").FindChild("Right").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color = new Color(1f, 1f, 1f, 50f / 255f); // if(!UtilMgr.IsMLB()) item.FindChild("Players").FindChild("Right").FindChild("Frame") .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70; // UtilMgr.LoadImage(data.hitterPhoto, // item.FindChild("Players").FindChild("Right").FindChild("Frame") // .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>()); item.FindChild("Players").FindChild("Right") .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "B"; // UtilMgr.LoadImage(data.pitcherPhoto, // item.FindChild("Players").FindChild("Left").FindChild("Frame") // .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>()); item.FindChild("Players").FindChild("Left") .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "P"; item.FindChild("Players").FindChild("Right") .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.hitterName; item.FindChild("Players").FindChild("Left") .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.pitcherName; } string dateTime = null; if (UtilMgr.IsMLB()) { dateTime = data.dateTime; } else { dateTime = data.korDateTime; } int year = 0, mon = 0, day = 0, hour = 0, min = 0, sec = 0; year = int.Parse(dateTime.Substring(0, 4)); mon = int.Parse(dateTime.Substring(4, 2)); day = int.Parse(dateTime.Substring(6, 2)); hour = int.Parse(dateTime.Substring(8, 2)); min = int.Parse(dateTime.Substring(10, 2)); sec = int.Parse(dateTime.Substring(12, 2)); if (data.status.Equals("Scheduled")) { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrGameReady"); item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color = new Color(255f / 255f, 91f / 255f, 16f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor = new Color(255f / 255f, 91f / 255f, 16f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().hover = new Color(255f / 255f, 91f / 255f, 16f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().pressed = new Color(255f / 255f, 91f / 255f, 16f / 255f); item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false); string strMin = min + " "; if (min < 10) { strMin = "0" + min + " "; } if (UtilMgr.IsMLB()) { item.FindChild("Players").GetComponent <UILabel>().text = "ET " + UtilMgr.GetAMPM(hour)[0] + ":" + strMin + UtilMgr.GetAMPM(hour)[1]; } else { item.FindChild("Players").GetComponent <UILabel>().text = "KST " + UtilMgr.GetAMPM(hour)[0] + ":" + strMin + UtilMgr.GetAMPM(hour)[1]; } } else if (data.status.Equals("InProgress")) { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = UtilMgr.GetLocalText("LblEnter"); item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color = new Color(0 / 255f, 106f / 255f, 216f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor = new Color(0 / 255f, 106f / 255f, 216f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().hover = new Color(0 / 255f, 106f / 255f, 216f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().pressed = new Color(1f, 91f / 255f, 16f / 255f); item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(true); if (!UtilMgr.IsMLB()) { if (data.inningState.Equals("END")) { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = "공수 교대 중"; } } } else if (data.status.Equals("Final")) { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrGameOver"); item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().hover = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().pressed = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false); } else if (data.status.Equals("Postponed")) { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrPostponed"); item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().hover = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().pressed = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false); } else if (data.status.Equals("Cancel")) { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrGameCanceled"); item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().hover = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().pressed = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false); } else { item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrGameOver"); item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().hover = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("BtnEnter").GetComponent <UIButton>().pressed = new Color(102f / 255f, 102f / 255f, 102f / 255f); item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false); } if (data.joinYN > 0) { item.FindChild("Top").FindChild("SprJoined").gameObject.SetActive(true); } else { item.FindChild("Top").FindChild("SprJoined").gameObject.SetActive(false); } } // transform.FindChild("ScrollRT").GetComponent<UIScrollView>().ResetPosition(); transform.FindChild("ScrollRT").GetComponent <UICenterOnChild>().Recenter(); if (transform.root.FindChild("Lobby").GetComponent <Lobby>().mState != UtilMgr.STATE.Lobby) { UtilMgr.AnimatePageToRight( transform.root.FindChild("Lobby").GetComponent <Lobby>().mState.ToString(), "Lobby", new EventDelegate(AnimationFinish)); transform.root.FindChild("Lobby").GetComponent <Lobby>().mState = UtilMgr.STATE.Lobby; } else { AnimationFinish(); } }
void ReceivedDetails() { if (Localization.language.Equals("English")) { transform.FindChild("InfoTop").FindChild("LblTitle").GetComponent <UILabel>().text = mContest.contestName; } else { transform.FindChild("InfoTop").FindChild("LblTitle").GetComponent <UILabel>().text = mContest.contestNameKor; } string strMin = "" + mContestTime.Minute; if (mContestTime.Minute < 10) { strMin = "0" + mContestTime.Minute; } if (UtilMgr.IsMLB()) { transform.FindChild("InfoTop").FindChild("Time").FindChild("LblLeft").GetComponent <UILabel>().text = "ET " + UtilMgr.GetAMPM(mContestTime.Hour)[0] + ":" + strMin + " " + UtilMgr.GetAMPM(mContestTime.Hour)[1] ; //+ " " + UtilMgr.GetLocalText("StrStart"); } else { if (Localization.language.Equals("English")) { transform.FindChild("InfoTop").FindChild("Time").FindChild("LblLeft").GetComponent <UILabel>().text = "KST " + UtilMgr.GetAMPM(mContestTime.Hour)[0] + ":" + strMin + " " + UtilMgr.GetAMPM(mContestTime.Hour)[1] ; //+ " " + UtilMgr.GetLocalText("StrStart"); } else { transform.FindChild("InfoTop").FindChild("Time").FindChild("LblLeft").GetComponent <UILabel>().text = "KST " + UtilMgr.GetAMPM(mContestTime.Hour)[0] + ":" + strMin + " " + UtilMgr.GetAMPM(mContestTime.Hour)[1] ; //+ " " + UtilMgr.GetLocalText("StrStart"); } } transform.FindChild("InfoTop").FindChild("Time").FindChild("LblRight").GetComponent <UILabel>().text = ""; if (mContest.contestStatus == ContestListInfo.STATUS_UP) { transform.FindChild("InfoTop").FindChild("Labels").FindChild("LblEntries").FindChild("Label"). GetComponent <UILabel>().text = "[b]" + UtilMgr.AddsThousandsSeparator(mContestEvent.Response.data.totalJoin) + "[/b][cccccc] / " + UtilMgr.AddsThousandsSeparator(mContestEvent.Response.data.totalEntry); } else { transform.FindChild("InfoTop").FindChild("Labels").FindChild("LblEntries").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrPosition"); transform.FindChild("InfoTop").FindChild("Labels").FindChild("LblEntries").FindChild("Label"). GetComponent <UILabel>().text = "[b]" + UtilMgr.AddsThousandsSeparator(mContestEvent.Response.data.myRank) + "[/b][cccccc] / " + UtilMgr.AddsThousandsSeparator(mContestEvent.Response.data.totalJoin); } transform.FindChild("InfoTop").FindChild("Labels").FindChild("LblTickets").FindChild("Label").GetComponent <UILabel>(). text = mContestEvent.Response.data.entryTicket + ""; transform.FindChild("InfoTop").FindChild("Labels").FindChild("LblPrize").FindChild("Label").GetComponent <UILabel>(). text = mContestEvent.Response.data.totalReward + "G"; InitEntries(); InitGames(); InitPrizes(); InitRules(); transform.FindChild("Selection").FindChild("BtnEntries").GetComponent <ContestDetailBtns>().OnClick(); UtilMgr.AddBackState(UtilMgr.STATE.ContestDetails); UtilMgr.AnimatePageToLeft("MyContests", "ContestDetails"); }
bool InitPlayerInfo() { // if(UtilMgr.IsMLB()){ // transform.FindChild("Info").FindChild ("MLB").gameObject.SetActive(true); // transform.FindChild("Info").FindChild ("KBO").gameObject.SetActive(false); // // transform.FindChild("Info").FindChild ("MLB").FindChild("Panel").FindChild("Photo").GetComponent<UITexture>().mainTexture = mPhoto; // } else{ transform.FindChild("Body").FindChild("Info").FindChild("MLB").gameObject.SetActive(false); transform.FindChild("Body").FindChild("Info").FindChild("KBO").gameObject.SetActive(true); // } mPlayerInfo = null; try{ mPlayerInfo = UserMgr.PlayerDic[mPlayerId]; }catch {} // foreach( in UserMgr.PlayerList){ // if(info.playerId == ){ // mPlayerInfo = info; // break; // } // } if (mPlayerInfo == null) { // IsInactive = true; DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("StrPlayerInfo"), UtilMgr.GetLocalText("StrPlayerInactive") , DialogueMgr.DIALOGUE_TYPE.Alert, null); return(true); } if (mPlayerInfo.positionNo == 1) { IsPitcher = true; // mHand = info.throwHand.Equals("L") ? UtilMgr.GetLocalText("StrLeft") : UtilMgr.GetLocalText("StrRight"); if (mPlayerInfo.batHand == null) { mHand = ""; } else if (mPlayerInfo.throwHand.Equals("S")) { mHand = UtilMgr.GetLocalText("StrSwitch"); } else if (mPlayerInfo.throwHand.Equals("L")) { mHand = UtilMgr.GetLocalText("StrLeft"); } else { mHand = UtilMgr.GetLocalText("StrRight"); } } else { IsPitcher = false; // mHand = info.batHand.Equals("L") ? UtilMgr.GetLocalText("StrLeft") : UtilMgr.GetLocalText("StrRight"); if (mPlayerInfo.batHand == null) { mHand = ""; } else if (mPlayerInfo.batHand.Equals("S")) { mHand = UtilMgr.GetLocalText("StrSwitch"); } else if (mPlayerInfo.batHand.Equals("L")) { mHand = UtilMgr.GetLocalText("StrLeft"); } else { mHand = UtilMgr.GetLocalText("StrRight"); } } if (mPlayerInfo.injuryYN.Equals("N")) { transform.FindChild("Body").FindChild("Info").FindChild("Injury").gameObject.SetActive(false); } else { transform.FindChild("Body").FindChild("Info").FindChild("Injury").gameObject.SetActive(true); } if (UtilMgr.IsMLB()) { if (mPlayerInfo.firstName.Length < 1) { transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text = mPlayerInfo.lastName; } else { transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text = mPlayerInfo.firstName.Substring(0, 1) + ". " + mPlayerInfo.lastName; } } else { if (Localization.language.Equals("English")) { if (mPlayerInfo.firstName.Length < 1) { transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text = mPlayerInfo.lastName; } else { transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text = mPlayerInfo.firstName.Substring(0, 1) + ". " + mPlayerInfo.lastName; } } else { transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text = mPlayerInfo.korName; } } transform.FindChild("Body").FindChild("Info").FindChild("LblSaraly").GetComponent <UILabel>().text = "$" + mPlayerInfo.salary; transform.FindChild("Body").FindChild("Info").FindChild("LblFPPG").FindChild("Label").GetComponent <UILabel>().text = string.Format("{0:F1}", mPlayerInfo.fppg); transform.FindChild("Body").FindChild("Info").FindChild("LblPlayed").FindChild("Label").GetComponent <UILabel>().text = "" + mPlayerInfo.games; transform.FindChild("Body").FindChild("Info").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = mPlayerInfo.position; if (IsCard) { transform.FindChild("Body").FindChild("SprGrade").GetComponent <UISprite>().spriteName = "card_top_bg_" + mCardInfo.cardClass; transform.FindChild("Body").FindChild("SprGrade").gameObject.SetActive(true); } else { transform.FindChild("Body").FindChild("SprGrade").gameObject.SetActive(false); } TeamScheduleInfo schedule = null; foreach (TeamScheduleInfo info in UserMgr.ScheduleList) { if (mPlayerInfo.team == info.awayTeamId || mPlayerInfo.team == info.homeTeamId) { schedule = info; break; } } if (schedule != null) { transform.FindChild("Body").FindChild("Info").FindChild("LblPos").GetComponent <UILabel>().text = schedule.awayTeam + " @ " + schedule.homeTeam; int hour = 1; string min = ""; if (UtilMgr.IsMLB()) { hour = int.Parse(schedule.dateTime.Substring(8, 2)); min = schedule.dateTime.Substring(10, 2); transform.FindChild("Body").FindChild("Info").FindChild("LblTime").GetComponent <UILabel>().text = schedule.day + " ET " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1]; } else { hour = int.Parse(schedule.korDateTime.Substring(8, 2)); min = schedule.korDateTime.Substring(10, 2); if (Localization.language.Equals("English")) { transform.FindChild("Body").FindChild("Info").FindChild("LblTime").GetComponent <UILabel>().text = schedule.day + " KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1]; } else { transform.FindChild("Body").FindChild("Info").FindChild("LblTime").GetComponent <UILabel>().text = "KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1] + " (" + UtilMgr.DayToKorean(schedule.day) + ")"; } } } if (mPhoto == null) { UtilMgr.LoadImage(mPlayerInfo.playerId, transform.FindChild("Body").FindChild("Info").FindChild("KBO").FindChild("Panel") .FindChild("Photo").GetComponent <UITexture>()); } else { transform.FindChild("Body").FindChild("Info").FindChild("KBO").FindChild("Panel").FindChild("Photo") .GetComponent <UITexture>().mainTexture = mPhoto; } return(false); }
public void InitBtm() { Transform btm = transform.FindChild("Body").FindChild("Scroll View").FindChild("Btm"); btm.gameObject.SetActive(true); mSortedLineup = new List <PlayerInfo>(); bool foundLast = false; bool isAway = false; if (mLineupResponse.data.inningHalf.Equals("T") && UserMgr.eventJoined.inningState.Equals("ING")) { isAway = true; } if (mLineupResponse.data.inningHalf.Equals("B") && UserMgr.eventJoined.inningState.Equals("END")) { isAway = true; } // T END, B ING // if((mLineupResponse.data.inningHalf.Equals("T") // && UserMgr.eventJoined.inningState.Equals("ING")) // || (mLineupResponse.data.inningHalf.Equals("B") // && UserMgr.eventJoined.inningState.Equals("END"))){ Debug.Log("isAway : " + isAway); if (isAway) { mPitcher = mLineupResponse.data.home.pit; for (int i = 0; i < mLineupResponse.data.away.hit.Count; i++) { if (mLineupResponse.data.away.hit[i].currentBatter > 0) { foundLast = true; for (int j = 0; j < mLineupResponse.data.away.hit.Count; j++) { // if(++i >= mLineupResponse.data.away.hit.Count) i = 0; if (i >= mLineupResponse.data.away.hit.Count) { i = 0; } mSortedLineup.Add(mLineupResponse.data.away.hit[i]); i++; } break; } } if (!foundLast) { for (int j = 0; j < mLineupResponse.data.away.hit.Count; j++) { if (j == 0) { mSortedLineup.Add(mLineupResponse.data.away.hit[mLineupResponse.data.away.hit.Count - 1]); } else { mSortedLineup.Add(mLineupResponse.data.away.hit[j - 1]); } } } } else { mPitcher = mLineupResponse.data.away.pit; for (int i = 0; i < mLineupResponse.data.home.hit.Count; i++) { if (mLineupResponse.data.home.hit[i].currentBatter > 0) { foundLast = true; for (int j = 0; j < mLineupResponse.data.home.hit.Count; j++) { // if(++i >= mLineupResponse.data.home.hit.Count) i = 0; if (i >= mLineupResponse.data.home.hit.Count) { i = 0; } mSortedLineup.Add(mLineupResponse.data.home.hit[i]); i++; } break; } } if (!foundLast) { for (int j = 0; j < mLineupResponse.data.home.hit.Count; j++) { if (j == 0) { mSortedLineup.Add(mLineupResponse.data.home.hit[mLineupResponse.data.away.hit.Count - 1]); } else { mSortedLineup.Add(mLineupResponse.data.home.hit[j - 1]); } } } } btm.FindChild("Info").FindChild("BG").FindChild("LblRound").gameObject.SetActive(true); btm.FindChild("Info").FindChild("BG").FindChild("LblName").gameObject.SetActive(true); if (Localization.language.Equals("English")) { string roundStr = mLineupResponse.data.inningHalf.Equals("T") ? "Top" : "Bot"; roundStr += " " + mLineupResponse.data.inningNumber + UtilMgr.GetRoundString(mLineupResponse.data.inningNumber); btm.FindChild("Info").FindChild("BG").FindChild("LblRound").GetComponent <UILabel>().text = roundStr; btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>().text = mPitcher.playerName; } else { string roundStr = mLineupResponse.data.inningNumber + (mLineupResponse.data.inningHalf.Equals("T") ? "회초" : "회말"); btm.FindChild("Info").FindChild("BG").FindChild("LblRound").GetComponent <UILabel>().text = roundStr; btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>().text = mPitcher.korName; } int width = btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>().width; btm.FindChild("Info").FindChild("BG").FindChild("LblName").FindChild("Label").localPosition = new Vector3(width + 16f, -3f); btm.FindChild("Info").FindChild("BG").FindChild("LblName").FindChild("Label").GetComponent <UILabel>() .text = "#" + mPitcher.backNumber + " ERA " + mPitcher.ERA; btm.FindChild("Info").FindChild("SprCircle").FindChild("Hand").FindChild("Label").GetComponent <UILabel>() .text = mPitcher.throwHand; btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel") .FindChild("Texture").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault(); btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel") .FindChild("Texture").GetComponent <UITexture>().width = 72; btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel") .FindChild("Texture").GetComponent <UITexture>().height = 90; UtilMgr.LoadImage(mPitcher.playerId, btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel") .FindChild("Texture").GetComponent <UITexture>()); btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().RemoveAll(); // if(IsEnded){ // ShowGameEnded(); // return; // } // UtilMgr.ClearList(btm.FindChild("Draggable")); btm.FindChild("Draggable").GetComponent <UIPanel>().clipOffset = new Vector2(0, 50f); btm.FindChild("Draggable").localPosition = new Vector3(0, -283f); btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().Init(mSortedLineup.Count, delegate(UIListItem item, int index) { Transform button = item.Target.transform.FindChild("Scroll View").FindChild("Button"); button.FindChild("Photo").FindChild("Hand").FindChild("Label").GetComponent <UILabel>() .text = mSortedLineup[index].batHand; string avg = mSortedLineup[index].AVG; for (int k = mSortedLineup[index].AVG.Length; k < 5; k++) { avg += "0"; } button.FindChild("Label").GetComponent <UILabel>() .text = "#" + mSortedLineup[index].backNumber + " AVG " + avg; if (Localization.language.Equals("English")) { button.FindChild("LblName").GetComponent <UILabel>() .text = mSortedLineup[index].playerName; } else { button.FindChild("LblName").GetComponent <UILabel>() .text = mSortedLineup[index].korName; } button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault(); button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().width = 72; button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().height = 90; UtilMgr.LoadImage(mSortedLineup[index].playerId, button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>()); JoinQuizInfo joinInfo = new JoinQuizInfo(); joinInfo.gameId = UserMgr.eventJoined.gameId; joinInfo.bingoId = mBingoId; if (mLineupResponse == null) { return; } joinInfo.inningNumber = mLineupResponse.data.inningNumber; joinInfo.inningHalf = mLineupResponse.data.inningHalf; joinInfo.battingOrder = mSortedLineup[index].battingOrder; joinInfo.playerId = mSortedLineup[index].playerId; // // joinInfo.checkValue = -1; // foreach(CurrentLineupInfo.ForecastInfo forecast in mLineupEvent.Response.data.forecast){ // if(forecast.battingOrder == joinInfo.battingOrder){ // joinInfo.checkValue = forecast.myValue; // break; // } // } // item.Target.GetComponent <ItemBingoList>().Init(joinInfo); if (!UserMgr.eventJoined.status.Equals("Scheduled")) { int lockCnt = 1; if (UtilMgr.IsMLB()) { lockCnt = 2; } if (index < lockCnt) { item.Target.GetComponent <ItemBingoList>().SetToLocking(); } } }); if (UserMgr.eventJoined.status.Equals("Scheduled")) { transform.root.FindChild("LiveBingo").GetComponent <LiveBingoAnimation>().SetItemBlink(-1); } else { transform.root.FindChild("LiveBingo").GetComponent <LiveBingoAnimation>() .SetItemBlink(mSortedLineup[0].playerId); } btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition(); // UtilMgr.ClearList(btm.FindChild("Draggable")); // float height = 90f; // for(int index = 0; index < mSortedLineup.Count; index++){ // GameObject go = Instantiate(mItemBingoList); // go.transform.parent = btm.FindChild("Draggable"); // go.transform.localScale = new Vector3(1f, 1f, 1f); // go.transform.localPosition = new Vector3(0, height); // height -= 120f; // Transform button = go.transform.FindChild("Scroll View").FindChild("Button"); // button.FindChild("Photo").FindChild("Hand").FindChild("Label").GetComponent<UILabel>() // .text = mSortedLineup[index].batHand; // button.FindChild("Label").GetComponent<UILabel>() // .text = "#" + mSortedLineup[index].backNumber + " AVG " + mSortedLineup[index].AVG; // // if(Localization.language.Equals("English")){ // button.FindChild("LblName").GetComponent<UILabel>() // .text = mSortedLineup[index].playerName; // } else{ // button.FindChild("LblName").GetComponent<UILabel>() // .text = mSortedLineup[index].korName; // } // button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>().mainTexture // = UtilMgr.GetTextureDefault(); // button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>().width = 72; // button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>().height = 90; // UtilMgr.LoadImage(mSortedLineup[index].photoUrl, // button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>()); // // JoinQuizInfo joinInfo = new JoinQuizInfo(); // joinInfo.gameId = UserMgr.eventJoined.gameId; // joinInfo.bingoId = mBingoId; // joinInfo.inningNumber = mLineupEvent.Response.data.inningNumber; // joinInfo.inningHalf = mLineupEvent.Response.data.inningHalf; // joinInfo.battingOrder = mSortedLineup[index].battingOrder; // joinInfo.playerId = mSortedLineup[index].playerId; // go.GetComponent<ItemBingoList>().Init(joinInfo); // // if(index < 2) // go.GetComponent<ItemBingoList>().SetToLocking(); // } // btm.FindChild("Draggable").GetComponent<UIScrollView>().ResetPosition(); }
public void AddLog(SocketMsgInfo info) { // mStrLog += log; // string msg = "\n[00ff00][" + UtilMgr.GetDateTimeNow("HH:mm:ss") + "]" + "Send:7000[-]"; string value = "\n[" + UtilMgr.GetDateTimeNow("HH:mm:ss") + "]"; switch (info.type) { case ConstantsSocketType.RES.TYPE_JOIN: value += "[00ff00]Received:Join"; break; case ConstantsSocketType.RES.TYPE_ALIVE_OK: value += "[00ff00]Received:Alive"; break; case ConstantsSocketType.RES.RESULT_HITTER: value += "[ff0000]Received:ResultHitter("; PlayerInfo player = null; try{ player = UserMgr.PlayerDic[info.data.playerId]; } catch { player = new PlayerInfo(); if (UtilMgr.IsMLB()) { player.lastName = "Unknown:" + info.data.playerId; } else { player.korName = "선수정보없음:" + info.data.playerId; } } if (UtilMgr.IsMLB()) { value += player.lastName + "," + info.data.result + "," + info.data.value + ")"; break; } else { value += player.korName + "," + info.data.result + "," + info.data.value + ")"; break; } case ConstantsSocketType.RES.CHANGE_PLAYER: value += "[ff00ff]Received:ChangePlayer("; PlayerInfo hitter = null; PlayerInfo pitcher = null; try{ hitter = UserMgr.PlayerDic[info.data.playerId]; } catch { hitter = new PlayerInfo(); if (UtilMgr.IsMLB()) { hitter.lastName = "Unknown:" + info.data.playerId; } else { hitter.korName = "선수정보없음:" + info.data.playerId; } } try{ pitcher = UserMgr.PlayerDic[info.data.pitcherId]; } catch { pitcher = new PlayerInfo(); if (UtilMgr.IsMLB()) { pitcher.lastName = "Unknown:" + info.data.playerId; } else { pitcher.korName = "선수정보없음:" + info.data.pitcherId; } } if (UtilMgr.IsMLB()) { value += "hit:" + hitter.lastName + ",pit:" + pitcher.lastName + ")"; break; } else { value += "hit:" + hitter.korName + ",pit:" + pitcher.korName + ")"; break; } case ConstantsSocketType.RES.RELOAD_BINGO: value += "[ffff00]Received:UpdateBingo"; break; case ConstantsSocketType.RES.CHANGE_INNING: value += "[00ffff]Received:ChangeInning("; value += info.data.inning + "," + info.data.inningHalf + "," + info.data.inningState + ")"; break; default: value += "[ffffff]Recieved:" + info.type; break; } value += "[-]," + info.data.msgCount; mStrLog += value; Reposition(); }