Files
Studio/Assets/NewStudioPGD/Scripts/UI/Element/UI_AuthenticationItem.cs

36 lines
972 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine.UI;
using XRLib.UI;
namespace Studio.UI
{
public class UI_AuthenticationItem : UIBase
{
public TMP_InputField InputField;
public TMP_Dropdown Dropdown;
public Button Button_Remove;
public enum EType
{
String,
Int,
Boolean,
}
private void Awake()
{
InputField = transform.Find(nameof(InputField)).GetComponent<TMP_InputField>();
Dropdown = transform.Find (nameof(Dropdown)).GetComponent<TMP_Dropdown>();
Button_Remove = transform.Find(nameof(Button_Remove)).GetComponent<Button>();
Button_Remove.onClick.AddListener(() => Destroy(gameObject));
List<string> options = Enum.GetNames(typeof(EType)).ToList();
Dropdown.ClearOptions();
Dropdown.AddOptions(options);
}
}
}