【m】修改使用AssetDatabse导致的打包报错问题
1.铮哥不让我给配置文件加单例 2.这是个runtime类不能用AssetDatabse(之前没注意到)
This commit is contained in:
@@ -20,30 +20,6 @@ namespace Stary.Evo
|
||||
[TabGroup("BuildConfig")]
|
||||
[InlineProperty, HideLabel]
|
||||
public BuildConfig buildConfig;
|
||||
|
||||
private static HotfixMainResDomain globalInstance;
|
||||
public static HotfixMainResDomain Get
|
||||
{
|
||||
get
|
||||
{
|
||||
// 在Resources目录下查找配置
|
||||
if (globalInstance == null)
|
||||
{
|
||||
globalInstance = Resources.Load<HotfixMainResDomain>("HotfixMainResDomain");
|
||||
}
|
||||
// 无该配置时尝试创建
|
||||
else if (globalInstance == null)
|
||||
{
|
||||
globalInstance = CreateInstance<HotfixMainResDomain>();
|
||||
var path = AssetDatabase.GenerateUniqueAssetPath("Resources/HotfixMainResDomain.asset");
|
||||
AssetDatabase.CreateAsset(globalInstance, path);
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
// 返回热更资源配置
|
||||
return globalInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
Reference in New Issue
Block a user