bad-piggies-0.1.3-porting/Assets/Scripts/Assembly-CSharp/AchievementPopup.cs

41 lines
990 B
C#
Raw Normal View History

2024-02-24 22:40:44 -05:00
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<TextMesh>();
m_icon = base.transform.FindChild("Popup/Icon").renderer.material;
m_localeText = base.transform.FindChild("Popup/Text").GetComponent<TextMeshLocale>();
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);
}
}
}