update runtime code
This commit is contained in:
@@ -6,7 +6,7 @@ namespace YooAsset
|
||||
{
|
||||
internal class EditorSimulateModeImpl : IPlayModeServices, IBundleServices
|
||||
{
|
||||
private PatchManifest _activePatchManifest;
|
||||
private PatchManifest _activeManifest;
|
||||
private string _packageName;
|
||||
private bool _locationToLower;
|
||||
|
||||
@@ -23,24 +23,18 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
#region IPlayModeServices接口
|
||||
public PatchManifest ActivePatchManifest
|
||||
public PatchManifest ActiveManifest
|
||||
{
|
||||
set
|
||||
{
|
||||
_activePatchManifest = value;
|
||||
_activePatchManifest.InitAssetPathMapping(_locationToLower);
|
||||
_activeManifest = value;
|
||||
_activeManifest.InitAssetPathMapping(_locationToLower);
|
||||
}
|
||||
get
|
||||
{
|
||||
return _activePatchManifest;
|
||||
return _activeManifest;
|
||||
}
|
||||
}
|
||||
public string GetPackageVersion()
|
||||
{
|
||||
if (_activePatchManifest == null)
|
||||
return string.Empty;
|
||||
return _activePatchManifest.PackageVersion;
|
||||
}
|
||||
public bool IsBuildinPatchBundle(PatchBundle patchBundle)
|
||||
{
|
||||
return true;
|
||||
@@ -52,7 +46,7 @@ namespace YooAsset
|
||||
OperationSystem.StartOperation(operation);
|
||||
return operation;
|
||||
}
|
||||
UpdatePackageManifestOperation IPlayModeServices.UpdatePackageManifestAsync(string packageVersion, bool autoSaveManifestFile, int timeout)
|
||||
UpdatePackageManifestOperation IPlayModeServices.UpdatePackageManifestAsync(string packageVersion, int timeout)
|
||||
{
|
||||
var operation = new EditorPlayModeUpdatePackageManifestOperation();
|
||||
OperationSystem.StartOperation(operation);
|
||||
@@ -95,7 +89,7 @@ namespace YooAsset
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果补丁清单里未找到资源包会抛出异常!
|
||||
var patchBundle = _activePatchManifest.GetMainPatchBundle(assetInfo.AssetPath);
|
||||
var patchBundle = _activeManifest.GetMainPatchBundle(assetInfo.AssetPath);
|
||||
BundleInfo bundleInfo = new BundleInfo(patchBundle, BundleInfo.ELoadMode.LoadFromEditor, assetInfo.AssetPath);
|
||||
return bundleInfo;
|
||||
}
|
||||
@@ -105,22 +99,22 @@ namespace YooAsset
|
||||
}
|
||||
AssetInfo[] IBundleServices.GetAssetInfos(string[] tags)
|
||||
{
|
||||
return _activePatchManifest.GetAssetsInfoByTags(tags);
|
||||
return _activeManifest.GetAssetsInfoByTags(tags);
|
||||
}
|
||||
PatchAsset IBundleServices.TryGetPatchAsset(string assetPath)
|
||||
{
|
||||
if (_activePatchManifest.TryGetPatchAsset(assetPath, out PatchAsset patchAsset))
|
||||
if (_activeManifest.TryGetPatchAsset(assetPath, out PatchAsset patchAsset))
|
||||
return patchAsset;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
string IBundleServices.MappingToAssetPath(string location)
|
||||
{
|
||||
return _activePatchManifest.MappingToAssetPath(location);
|
||||
return _activeManifest.MappingToAssetPath(location);
|
||||
}
|
||||
string IBundleServices.TryMappingToAssetPath(string location)
|
||||
{
|
||||
return _activePatchManifest.TryMappingToAssetPath(location);
|
||||
return _activeManifest.TryMappingToAssetPath(location);
|
||||
}
|
||||
string IBundleServices.GetPackageName()
|
||||
{
|
||||
@@ -128,11 +122,11 @@ namespace YooAsset
|
||||
}
|
||||
bool IBundleServices.IsIncludeBundleFile(string fileName)
|
||||
{
|
||||
return _activePatchManifest.IsIncludeBundleFile(fileName);
|
||||
return _activeManifest.IsIncludeBundleFile(fileName);
|
||||
}
|
||||
bool IBundleServices.IsServicesValid()
|
||||
{
|
||||
return _activePatchManifest != null;
|
||||
return _activeManifest != null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user