49 lines
971 B
C#
49 lines
971 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SetNamePopUpItem : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private InputField inputField;
|
|
|
|
private DisplaySetName displaySetName;
|
|
|
|
[SerializeField]
|
|
private Button saveButton;
|
|
|
|
public Text customNameText;
|
|
|
|
public int SetID;
|
|
|
|
private void Start()
|
|
{
|
|
displaySetName = Object.FindObjectOfType<DisplaySetName>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (string.IsNullOrEmpty(inputField.text))
|
|
{
|
|
saveButton.interactable = false;
|
|
}
|
|
else
|
|
{
|
|
saveButton.interactable = true;
|
|
}
|
|
}
|
|
|
|
public void SetCustomName()
|
|
{
|
|
_ = GameManager.Instance._playerData.Player[GameManager.Instance._playerData.currentPlayerProfileIndex];
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().SetNames[SetID - 1] = inputField.text;
|
|
displaySetName.RefreshNames();
|
|
MonoBehaviour.print("Refresh Set Name " + SetID);
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
|
|
public void ClosePopUp()
|
|
{
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
}
|