mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-07-03 04:13:42 +00:00
Update YooAsset
This commit is contained in:
35
Assets/YooAsset/Runtime/Settings/YooAssetSettingsData.cs
Normal file
35
Assets/YooAsset/Runtime/Settings/YooAssetSettingsData.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
public static class ResourceSettingData
|
||||
{
|
||||
private static YooAssetSettings _setting = null;
|
||||
public static YooAssetSettings Setting
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_setting == null)
|
||||
LoadSettingData();
|
||||
return _setting;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载配置文件
|
||||
/// </summary>
|
||||
private static void LoadSettingData()
|
||||
{
|
||||
_setting = Resources.Load<YooAssetSettings>("YooAssetSettings");
|
||||
if (_setting == null)
|
||||
{
|
||||
YooLogger.Log("YooAsset use default settings.");
|
||||
_setting = ScriptableObject.CreateInstance<YooAssetSettings>();
|
||||
}
|
||||
else
|
||||
{
|
||||
YooLogger.Log("YooAsset use custom settings.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user