public void UpdateElapseTime(float time) { if (timeText != null) { TimeFormatHelper TFH = new TimeFormatHelper(); timeText.text = TFH.GetTimeFormat(time); } }
public void OnFailPanel(float clearTime, int numOfScript) { isPausePanel = false; TimeFormatHelper TFH = new TimeFormatHelper(); Text timeText = FailPanel.Find("Time/Text").GetComponent <Text>(); timeText.text = TFH.GetTimeFormat(clearTime); Text numOfScrptText = FailPanel.Find("ScriptCount/Text").GetComponent <Text>(); var SB = new StringBuilder(numOfScript.ToString()); SB.Append("개"); // Localization numOfScrptText.text = SB.ToString(); FailPanel.gameObject.SetActive(true); BlackCurtain.gameObject.SetActive(true); }
/* * IEnumerator HistoryButtonHide() * { * RectTransform panelPos = HistoryPanel.GetComponent<RectTransform>(); * * int deg = 0; * int startX = (int)panelPos.anchoredPosition.x; * int endX = startX - maxX; * int x = 0; * * while (deg <= UISLIDINGDEG) * { * * * panelPos.anchoredPosition = new Vector2(x, panelPos.anchoredPosition.y); * * deg += 8; * * yield return null; * } * } * * IEnumerator HistoryButtonShow() * { * * }*/ public void OnClearPanel(int count, float clearTime, int numOfScript) { buttonEvent.StopAllCoroutines(); if (clearCallback != null) { clearCallback(); } isPausePanel = false; ClearPanel.gameObject.SetActive(true); BlackCurtain.gameObject.SetActive(true); /* UI가 stage scene별로 있으므로 10스테이지의 다시하기 버튼만 UI에서 제거해줌 * // 10번째 스테이지인 경우 다음 스테이지 버튼을 꺼준다 * var curStageName = SceneManager.GetActiveScene().name; * if(curStageName[curStageName.Length - 1] == '0') * { * var nextBtn = ClearPanel.FindChild("NextButton"); * if (nextBtn != null) * nextBtn.GetComponent<UnityEngine.UI.Button>().interactable = false; * } */ TimeFormatHelper TFH = new TimeFormatHelper(); Text timeText = ClearPanel.Find("Time/Text").GetComponent <Text>(); timeText.text = TFH.GetTimeFormat(clearTime); Text numOfScrptText = ClearPanel.Find("ScriptCount/Text").GetComponent <Text>(); var SB = new StringBuilder(numOfScript.ToString()); SB.Append("개"); // Localization numOfScrptText.text = SB.ToString(); star1 = ClearPanel.Find("ParentStar1").Find("Star1"); star2 = ClearPanel.Find("ParentStar2").Find("Star2"); star3 = ClearPanel.Find("ParentStar3").Find("Star3"); if (count == 1) { star1.gameObject.SetActive(true); } if (count == 2) { star1.gameObject.SetActive(true); star2.gameObject.SetActive(true); } if (count == 3) { star1.gameObject.SetActive(true); star2.gameObject.SetActive(true); star3.gameObject.SetActive(true); } DataManager.Instance.AddDataStageClear(SceneManager.GetActiveScene().name, count); /* 스테이지 클리어 업적 달성 */ if (Social.localUser.authenticated) // 로그인이 되어 있는지 확인 { if (SceneManager.GetActiveScene().name == "Chapter1Stage_8") { // unlock achievement (achievement_1) Social.ReportProgress("CgkI0Njd1fQSEAIQBg", 100.0f, (bool success) => { // handle success or failure }); } else if (SceneManager.GetActiveScene().name == "Chapter2Stage_8") { // unlock achievement (achievement_2) Social.ReportProgress("CgkI0Njd1fQSEAIQBw", 100.0f, (bool success) => { // handle success or failure }); } else if (SceneManager.GetActiveScene().name == "Chapter3Stage_8") { // unlock achievement (achievement_3) Social.ReportProgress("CgkI0Njd1fQSEAIQCA", 100.0f, (bool success) => { // handle success or failure }); } else if (SceneManager.GetActiveScene().name == "Chapter4Stage_8") { // unlock achievement (achievement_4) Social.ReportProgress("CgkI0Njd1fQSEAIQCQ", 100.0f, (bool success) => { // handle success or failure }); } } }