Files
Studio/Assets/NewStudioPGD/Scripts/UI/Panel/Panel_AppSetting.cs

52 lines
1.1 KiB
C#
Raw Normal View History

2025-05-13 14:49:57 +09:00
using System;
using System.Collections.Generic;
2025-05-07 12:20:55 +09:00
using UnityEngine;
2025-05-08 16:29:30 +09:00
using UnityEngine.UI;
2025-05-07 12:20:55 +09:00
using XRLib.UI;
2025-05-20 16:25:58 +09:00
namespace Studio.UI
2025-05-07 12:20:55 +09:00
{
public class Panel_AppSetting : PanelBase
{
2025-05-08 16:29:30 +09:00
private GameObject itemPrefab;
2025-05-13 14:49:57 +09:00
private List<GameObject> items = new();
2025-05-08 16:29:30 +09:00
private RectTransform Info;
public Button Button_Add;
public Button Button_Save;
2025-05-13 14:49:57 +09:00
public Action onRemove;
2025-05-08 16:29:30 +09:00
public override void AfterAwake()
{
itemPrefab = Resources.Load<GameObject>("Prefabs/UI/PRF_AppSettingItem");
Button_Add.onClick.AddListener(AddItem);
Button_Save.onClick.AddListener(OnClickSave);
AddItem();
}
private void AddItem()
{
GameObject item = Instantiate(itemPrefab, Info);
item.transform.SetSiblingIndex(Info.childCount - 2);
2025-05-13 14:49:57 +09:00
items.Add(item);
2025-05-08 16:29:30 +09:00
}
2025-05-13 14:49:57 +09:00
private void Init()
{
foreach (GameObject item in items)
{
Destroy(item);
}
items.Clear();
2025-05-08 16:29:30 +09:00
}
2025-05-13 14:49:57 +09:00
private void OnClickSave()
2025-05-07 12:20:55 +09:00
{
2025-05-13 14:49:57 +09:00
2025-05-07 12:20:55 +09:00
}
}
}