Files
plugin-library/Assets/06.UIFarme/RunTime/UIFramework/UIViewBase/UIConfig.cs

64 lines
1.6 KiB
C#
Raw Normal View History

2025-09-23 11:18:38 +08:00
using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.Serialization;
using YooAsset;
namespace Stary.Evo
{
[System.Serializable]
public class UIConfigJson
{
public string uiType;
public string pathId;
public string path;
public bool isWindow;
public UILayer uiLayer;
}
[CreateAssetMenu(menuName = "Evo/UIConfig")]
public class UIConfig : ScriptableObject
{
public string domain;
public List<UIConfigJson> uiConfigJsons;
private const string UIConfigPath = "Assets/UI/UISystemPackage/UIConfig.json";
public const string UIPackageName = "PanelPackage";
public List<UIConfigJson> GetAllConfigs()
{
if (uiConfigJsons.Count > 0)
{
return uiConfigJsons;
}
else
{
Debug.LogError("No UIConfigs found in domain: " + domain);
}
return null;
}
public static Type GetType(string typeName)
{
var type = Type.GetType(typeName);
if (type != null)
{
return type;
}
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (System.Reflection.Assembly assembly in assemblies)
{
type = Type.GetType(string.Format("{0}, {1}", typeName, assembly.FullName));
if (type != null)
{
return type;
}
}
return null;
}
}
}