using System.Collections; using UnityEngine; public class AchievementPopup : MonoBehaviour { private GameObject m_popup; private Material m_icon; private TextMesh m_text; private TextMeshLocale m_localeText; private void Start() { m_popup = base.transform.FindChild("Popup").gameObject; m_text = base.transform.FindChild("Popup/Text").GetComponent(); m_icon = base.transform.FindChild("Popup/Icon").renderer.material; m_localeText = base.transform.FindChild("Popup/Text").GetComponent(); m_popup.transform.position = Vector3.up * 13f; Object.DontDestroyOnLoad(this); } public void Show(string achievementId) { m_text.text = achievementId; m_icon.mainTexture = AchievementData.Instance.AchievementsLimits[achievementId].icon; m_localeText.RefreshTranslation(); m_popup.animation.Play("AchievementPopupEnter"); } private IEnumerator Test() { while (true) { Show("test"); yield return new WaitForSeconds(3f); } } }