46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using UnityEngine;
|
|
using XRLib.UI;
|
|
using TMPro;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace XED
|
|
{
|
|
public enum DataStyle
|
|
{
|
|
Vector2,
|
|
Vector3,
|
|
Float,
|
|
Int,
|
|
String
|
|
}
|
|
public class UI_DynamicDataStyleItem : UIBase
|
|
{
|
|
private TextMeshProUGUI Text_DataName;
|
|
private TMP_Dropdown Dropdown_DataDisplayStyle;
|
|
|
|
public void SetData(Datum datum)
|
|
{
|
|
Text_DataName.SetText(datum.dataName);
|
|
SetDataDisplayStyleDropdown();
|
|
}
|
|
private void SetDataDisplayStyleDropdown()
|
|
{
|
|
Dropdown_DataDisplayStyle.ClearOptions();
|
|
var types = Enum.GetNames(typeof(DataStyle));
|
|
List<string> options = new List<string>();
|
|
|
|
for (int i = 0; i < types.Length; i++)
|
|
{
|
|
options.Add(types[i]);
|
|
}
|
|
Dropdown_DataDisplayStyle.AddOptions(options);
|
|
Dropdown_DataDisplayStyle.onValueChanged.AddListener(OnDataDisplayStyleValueChanged);
|
|
}
|
|
private void OnDataDisplayStyleValueChanged(int index)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|