109 lines
2.9 KiB
C#
109 lines
2.9 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Security.Cryptography;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class FursuitAddCtrl : SingletonMonoBehaviour<FursuitAddCtrl>
|
|
{
|
|
[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)];
|
|
}
|
|
}
|