앱 설정 모달

This commit is contained in:
geondo55
2025-05-08 16:29:30 +09:00
parent f4aae5ecb8
commit 6611cf4f9b
8 changed files with 6559 additions and 148 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine.UI;
using XRLib.UI;
namespace XED.UI
{
public class UI_AppSettingItem : UIBase
{
public TMP_InputField InputField_Type;
public TMP_InputField InputField_Value;
public TMP_Dropdown Dropdown;
public Button Button_Remove;
public enum EType
{
APIDomain,
APIPort,
API,
MQTTDomain,
MQTTPort
}
private void Awake()
{
InputField_Type = transform.GetComponentsInChildren<TMP_InputField>().FirstOrDefault(x => x.name == nameof(InputField_Type));
InputField_Value = transform.GetComponentsInChildren<TMP_InputField>().FirstOrDefault(x => x.name == nameof(InputField_Value));
Dropdown = transform.GetComponentInChildren<TMP_Dropdown>();
Button_Remove = transform.GetComponentInChildren<Button>();
Button_Remove.onClick.AddListener(() => Destroy(gameObject));
List<string> options = Enum.GetNames(typeof(EType)).ToList();
Dropdown.ClearOptions();
Dropdown.AddOptions(options);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a3bb371cc7ac46f4ea9d3afec9ab2a6e

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using XRLib.UI;
@@ -12,22 +13,23 @@ namespace XED.UI
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(OnClickRemove);
Button_Remove.onClick.AddListener(() => Destroy(gameObject));
List<string> options = new List<string> { "String", "Int", "Boolean" };
List<string> options = Enum.GetNames(typeof(EType)).ToList();
Dropdown.ClearOptions();
Dropdown.AddOptions(options);
}
private void OnClickRemove()
{
print("remove");
Destroy(gameObject);
}
}
}