【m】修改使用AssetDatabse导致的打包报错问题
1.铮哥不让我给配置文件加单例 2.这是个runtime类不能用AssetDatabse(之前没注意到)
This commit is contained in:
@@ -20,30 +20,6 @@ namespace Stary.Evo
|
|||||||
[TabGroup("BuildConfig")]
|
[TabGroup("BuildConfig")]
|
||||||
[InlineProperty, HideLabel]
|
[InlineProperty, HideLabel]
|
||||||
public BuildConfig buildConfig;
|
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]
|
[Serializable]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.main",
|
"name": "com.staryevo.main",
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"displayName": "00.StaryEvo",
|
"displayName": "00.StaryEvo",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace Stary.Evo.Editor
|
|||||||
private string[] _scenePaths;
|
private string[] _scenePaths;
|
||||||
private string _buildAssetTagName;
|
private string _buildAssetTagName;
|
||||||
private string buildAPKTagName;
|
private string buildAPKTagName;
|
||||||
|
private HotfixMainResDomain _hotfixMainResDomain => Resources.Load<HotfixMainResDomain>("HotfixMainResDomain");
|
||||||
|
|
||||||
[Title("设备类型选择", titleAlignment: TitleAlignments.Centered)] [EnumToggleButtons, HideLabel]
|
[Title("设备类型选择", titleAlignment: TitleAlignments.Centered)] [EnumToggleButtons, HideLabel]
|
||||||
public DeviceType deviceType = DeviceType.Xreal;
|
public DeviceType deviceType = DeviceType.Xreal;
|
||||||
@@ -91,7 +92,7 @@ namespace Stary.Evo.Editor
|
|||||||
{
|
{
|
||||||
buildStatus = "就绪";
|
buildStatus = "就绪";
|
||||||
|
|
||||||
selectedPackageInfo = HotfixMainResDomain.Get.buildConfig.Get(packageID).info;
|
selectedPackageInfo = _hotfixMainResDomain.buildConfig.Get(packageID).info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -100,7 +101,7 @@ namespace Stary.Evo.Editor
|
|||||||
/// <param name="packageID"></param>
|
/// <param name="packageID"></param>
|
||||||
private void OnPackageSelectedOptionChanged(string packageID)
|
private void OnPackageSelectedOptionChanged(string packageID)
|
||||||
{
|
{
|
||||||
selectedPackageInfo = HotfixMainResDomain.Get.buildConfig.Get(packageID).info;
|
selectedPackageInfo = _hotfixMainResDomain.buildConfig.Get(packageID).info;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -236,7 +237,7 @@ namespace Stary.Evo.Editor
|
|||||||
var packageID = selectionOfPackages[current];
|
var packageID = selectionOfPackages[current];
|
||||||
Debug.Log($"正在打包:{packageID}");
|
Debug.Log($"正在打包:{packageID}");
|
||||||
// 获取包体配置
|
// 获取包体配置
|
||||||
selectedPackageInfo = HotfixMainResDomain.Get.buildConfig.Get(packageID).info;
|
selectedPackageInfo = _hotfixMainResDomain.buildConfig.Get(packageID).info;
|
||||||
// 打包
|
// 打包
|
||||||
await BuildAndroid(playMode);
|
await BuildAndroid(playMode);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.tools",
|
"name": "com.staryevo.tools",
|
||||||
"version": "1.3.33",
|
"version": "1.3.34",
|
||||||
"displayName": "00.StaryEvo.Tools",
|
"displayName": "00.StaryEvo.Tools",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user