优化卸载逻辑
All checks were successful
Plugin Library CI / publish (00.ARMazTools) (push) Successful in 3s
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 3s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 6s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 19s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 34s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 4s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 16s
Plugin Library CI / publish (07.RKTools) (push) Successful in 3s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 17s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s
All checks were successful
Plugin Library CI / publish (00.ARMazTools) (push) Successful in 3s
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 3s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 6s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 19s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 34s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 4s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 16s
Plugin Library CI / publish (07.RKTools) (push) Successful in 3s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 17s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s
This commit is contained in:
@@ -15,12 +15,6 @@ namespace Stary.Evo
|
||||
public ResStartState(IFsmSystemAsync system) : base(system)
|
||||
{
|
||||
}
|
||||
|
||||
public override UniTask OnEnterAsync()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public override async UniTask OnEnterAsync<T1, T2>(T1 param1, T2 param2)
|
||||
{
|
||||
if (AppConfig.DeveloperMode)
|
||||
@@ -29,6 +23,10 @@ namespace Stary.Evo
|
||||
Type type = param2 as Type;
|
||||
|
||||
GameObject mainPrefab = null;
|
||||
|
||||
//加载前卸载资源
|
||||
await DomainAssetSystem.RemoveDomain(domainConfig);
|
||||
|
||||
switch (domainConfig.loadResType)
|
||||
{
|
||||
case DomainConfig.LoadResType.Prefab:
|
||||
@@ -55,6 +53,7 @@ namespace Stary.Evo
|
||||
SceneManager.SetActiveScene(targetScene);
|
||||
mainPrefab = await DomainAssetSystem.LoadDomainPrefab(domainConfig);
|
||||
SceneManager.MoveGameObjectToScene(mainPrefab, targetScene);
|
||||
DomainAssetSystem.AddDomainNameEntity(domainConfig);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -64,17 +63,6 @@ namespace Stary.Evo
|
||||
}
|
||||
|
||||
|
||||
public override async UniTask OnExitAsync()
|
||||
{
|
||||
if (domainConfig.loadResType == DomainConfig.LoadResType.Prefab &&
|
||||
domainConfig.domainLoadType == DomainConfig.DomainLoadType.Single)
|
||||
{
|
||||
await DomainAssetSystem.UnloadDomainAsset();
|
||||
}
|
||||
else if (domainConfig.loadResType == DomainConfig.LoadResType.Scene)
|
||||
{
|
||||
await DomainAssetSystem.UnloadSceneAsset(domainConfig);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user