2025-07-16 13:36:21 +08:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2025-07-20 01:24:55 +08:00
|
|
|
public class UIViewExport : MonoBehaviour
|
2025-07-16 13:36:21 +08:00
|
|
|
{
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class UIEntry
|
|
|
|
|
{
|
|
|
|
|
public string key;
|
|
|
|
|
public GameObject prefab;
|
|
|
|
|
public string selectedComponentName; // 存储选择的组件类型名
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<UIEntry> entries = new List<UIEntry>();
|
2025-07-25 00:14:42 +08:00
|
|
|
|
|
|
|
|
public GameObject GetGameObject(string name)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < entries.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (entries[i].key == name)
|
|
|
|
|
{
|
|
|
|
|
return entries[i].prefab;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2025-07-16 13:36:21 +08:00
|
|
|
}
|