using UnityEngine; using UnityEngine.UI; public class ProfileCreation : MonoBehaviour { public ProfileSlot[] profilesContainer; public int profileIDtoDellete = -1; public Button getCloudeButton; private bool checkloadprofile; public MainGameScene mainGameScene; private void Start() { Singleton.Instance.StartControllerPopUpWork(); ShowProfileSlots(); } public void LoadProfiles() { if (Singleton.Instance.isLoadedProfiles && !checkloadprofile) { ResetViewAllProfiles(); ShowProfileSlots(); checkloadprofile = true; } } private void ResetViewAllProfiles() { for (int i = 0; i < profilesContainer.Length; i++) { profilesContainer[i].profileContainer.gameObject.SetActive(value: false); } } public void ShowProfileSlots() { for (int i = 0; i < Singleton.Instance.PlayerData.Count; i++) { SaveDataManager.SavePlayerDataClass specifiedPlayerData = Singleton.Instance.GetSpecifiedPlayerData(i); if (specifiedPlayerData.IsEnabled) { profilesContainer[i].profileNameText.text = specifiedPlayerData.PlayerName; profilesContainer[i].profileLevelText.text = specifiedPlayerData.PlayerLevel.ToString(); profilesContainer[i].profileTotalFishText.text = specifiedPlayerData.TotalFish.ToString(); profilesContainer[i].profileContainer.gameObject.SetActive(value: true); profilesContainer[i].GetComponent().enabled = false; profilesContainer[i].GetComponent