3D 동적 객체 생성 설정 모달 및 UI 동적 생성 모달 UI 작업
This commit is contained in:
45
Assets/NewStudioJYM/Scripts/UI_DynamicDataStyleItem.cs
Normal file
45
Assets/NewStudioJYM/Scripts/UI_DynamicDataStyleItem.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user