64 lines
1.6 KiB
C#
64 lines
1.6 KiB
C#
|
|
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;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|