31 lines
680 B
C#
31 lines
680 B
C#
using Michsky.UI.Heat;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class UI_ProfileName : MonoBehaviour
|
|
{
|
|
public PlayerProfile PlayerProfile;
|
|
|
|
[SerializeField]
|
|
private TextMeshProUGUI _ProfileNameText;
|
|
|
|
private void OnEnable()
|
|
{
|
|
PlayerProfileOnOnLoadData();
|
|
PlayerProfile.OnLoadData += PlayerProfileOnOnLoadData;
|
|
PlayerProfile.OnProfileCreated += PlayerProfileOnOnLoadData;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
PlayerProfile.OnLoadData -= PlayerProfileOnOnLoadData;
|
|
PlayerProfile.OnProfileCreated -= PlayerProfileOnOnLoadData;
|
|
}
|
|
|
|
private void PlayerProfileOnOnLoadData()
|
|
{
|
|
_ProfileNameText.text = PlayerProfile.Name;
|
|
GetComponent<LayoutGroupFix>().FixLayout();
|
|
}
|
|
}
|