using System; using System.Globalization; using System.Security.Cryptography; using TMPro; using UnityEngine; using UnityEngine.UI; public class FursuitAddCtrl : SingletonMonoBehaviour { [SerializeField] GameObject[] stepMenus; [SerializeField] TMP_Text xid; [SerializeField] TMP_InputField owner; [SerializeField] TMP_InputField introeuce; [SerializeField] TMP_InputField characterName; [SerializeField] TMP_InputField makerName; [SerializeField] TMP_Dropdown animalType; [SerializeField] TMP_Dropdown suitType; [SerializeField] TMP_Dropdown suitStyle; [SerializeField] TMP_Dropdown region; [SerializeField] TMP_InputField productionDate; [SerializeField] Toggle[] colors; [SerializeField] Sprite[] isOnSprite; [SerializeField] GameObject infoUI; [SerializeField] GameObject successUI; private void OnEnable() { UIReset(); } private void UIReset() { stepMenus[0].SetActive(false); stepMenus[1].SetActive(false); xid.text = string.Empty; owner.text = string.Empty; introeuce.text = string.Empty; characterName.text = string.Empty; makerName.text = string.Empty; animalType.value = 0; suitType.value = 0; suitStyle.value = 0; region.value = 0; productionDate.text = DateTime.Now.ToString("yyyy-MM-dd"); for (int n = 0; n < colors.Length; n++) { colors[n].isOn = false; colors[n].image.sprite = isOnSprite[0]; } } private bool DateTimeCheck(string dateString, out DateTime date) { return DateTime.TryParseExact(dateString, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out date); } public void SuccessButton() { if (xid.text == string.Empty) { Debug.Log("·Î±×ÀÎ ¾ÈµÊ"); return; } if (owner.text == string.Empty) { Debug.Log("¿À³Ê Á¤º¸ ¾øÀ½"); return; } if (characterName.text == string.Empty) { Debug.Log("Äɸ¯ÅÍ À̸§ ¾øÀ½"); return; } if (animalType.value == 0) { Debug.Log("µ¿¹° Á¤º¸ ¾øÀ½"); return; } if (suitType.value == 0) { Debug.Log("½´Æ® ŸÀÔ Á¤º¸ ¾øÀ½"); return; } if (suitStyle.value == 0) { Debug.Log("½´Æ®½ºÅ¸ÀÏ Á¤º¸ ¾øÀ½"); return; } if (region.value == 0) { Debug.Log("±¹°¡ Á¤º¸ ¾øÀ½"); return; } DateTime date; if (!DateTimeCheck(productionDate.text, out date)) { Debug.Log("³¯ÀÚ Á¤º¸ À߸øµÊ"); return; } infoUI.SetActive(false); successUI.SetActive(true); } public void OnToggle(int velue) { colors[velue].image.sprite = isOnSprite[(colors[velue].isOn ? 1 : 0)]; } }