完成 P2 第一阶段包与编辑器准备
This commit is contained in:
8
My project/Assets/AddressableAssetsData.meta
Normal file
8
My project/Assets/AddressableAssetsData.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f38893bbcb86bbb4cb6705a205682113
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 468a46d0ae32c3544b7d98094e6448a9, type: 3}
|
||||
m_Name: AddressableAssetSettings
|
||||
m_EditorClassIdentifier:
|
||||
m_DefaultGroup: 7a5b4d76501c82c408509719f87e537b
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_BundleLocalCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
m_DisableCatalogUpdateOnStart: 0
|
||||
m_IgnoreUnsupportedFilesInBuild: 0
|
||||
m_UniqueBundleIds: 0
|
||||
m_NonRecursiveBuilding: 1
|
||||
m_CCDEnabled: 0
|
||||
m_maxConcurrentWebRequests: 3
|
||||
m_ContiguousBundles: 1
|
||||
m_StripUnityVersionFromBundleBuild: 0
|
||||
m_DisableVisibleSubAssetRepresentations: 0
|
||||
m_ShaderBundleNaming: 0
|
||||
m_ShaderBundleCustomNaming:
|
||||
m_MonoScriptBundleNaming: 0
|
||||
m_CheckForContentUpdateRestrictionsOption: 0
|
||||
m_MonoScriptBundleCustomNaming:
|
||||
m_RemoteCatalogBuildPath:
|
||||
m_Id: 07b49c5050b466b429ffe37d3fea9381
|
||||
m_RemoteCatalogLoadPath:
|
||||
m_Id: 9acaa2031bf7fa240af17e019ab4a7ff
|
||||
m_ContentStateBuildPathProfileVariableName: <default settings path>
|
||||
m_CustomContentStateBuildPath:
|
||||
m_ContentStateBuildPath:
|
||||
m_BuildAddressablesWithPlayerBuild: 0
|
||||
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
|
||||
m_GroupAssets:
|
||||
- {fileID: 11400000, guid: cb21c9bd6efb15940aa0cc136e03ec0f, type: 2}
|
||||
- {fileID: 11400000, guid: ad50471a1bc339946b9dd02f9fd1b735, type: 2}
|
||||
m_BuildSettings:
|
||||
m_CompileScriptsInVirtualMode: 0
|
||||
m_CleanupStreamingAssetsAfterBuilds: 1
|
||||
m_LogResourceManagerExceptions: 1
|
||||
m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
|
||||
m_ProfileSettings:
|
||||
m_Profiles:
|
||||
- m_InheritedParent:
|
||||
m_Id: 7dc81bb5e6404c446a8e47e2b54e4880
|
||||
m_ProfileName: Default
|
||||
m_Values:
|
||||
- m_Id: 88540d677a2c08c42b7902abc4da490b
|
||||
m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]'
|
||||
- m_Id: 4be60150ce46e224586b89230ab67d48
|
||||
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
|
||||
- m_Id: 8dd5e21a04741aa4ab24bb52c0e3c5a3
|
||||
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
|
||||
- m_Id: 07b49c5050b466b429ffe37d3fea9381
|
||||
m_Value: ServerData/[BuildTarget]
|
||||
- m_Id: 9acaa2031bf7fa240af17e019ab4a7ff
|
||||
m_Value: http://[PrivateIpAddress]:[HostingServicePort]
|
||||
m_ProfileEntryNames:
|
||||
- m_Id: 88540d677a2c08c42b7902abc4da490b
|
||||
m_Name: BuildTarget
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 4be60150ce46e224586b89230ab67d48
|
||||
m_Name: Local.BuildPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 8dd5e21a04741aa4ab24bb52c0e3c5a3
|
||||
m_Name: Local.LoadPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 07b49c5050b466b429ffe37d3fea9381
|
||||
m_Name: Remote.BuildPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 9acaa2031bf7fa240af17e019ab4a7ff
|
||||
m_Name: Remote.LoadPath
|
||||
m_InlineUsage: 0
|
||||
m_ProfileVersion: 1
|
||||
m_LabelTable:
|
||||
m_LabelNames:
|
||||
- default
|
||||
m_SchemaTemplates: []
|
||||
m_GroupTemplateObjects:
|
||||
- {fileID: 11400000, guid: b8b58afcc1b4e244db44625e28a47b36, type: 2}
|
||||
m_InitializationObjects: []
|
||||
m_CertificateHandlerType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_ActivePlayerDataBuilderIndex: 3
|
||||
m_DataBuilders:
|
||||
- {fileID: 11400000, guid: ca567c17e92783c4d9869e540320d76f, type: 2}
|
||||
- {fileID: 11400000, guid: 9c179b50ddf0f4a49ba95a61fce40d9d, type: 2}
|
||||
- {fileID: 11400000, guid: e268c485b53ab6547bfc8919ae0f900d, type: 2}
|
||||
- {fileID: 11400000, guid: 7f9d8997bb36a7f44aabfe404cd182f8, type: 2}
|
||||
m_ActiveProfileId: 7dc81bb5e6404c446a8e47e2b54e4880
|
||||
m_HostingServicesManager:
|
||||
m_HostingServiceInfos: []
|
||||
m_Settings: {fileID: 11400000}
|
||||
m_NextInstanceId: 0
|
||||
m_RegisteredServiceTypeRefs: []
|
||||
m_PingTimeoutInMilliseconds: 5000
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c67335a4d75941d4881a64ebedebbce8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9bc8a0d61c2e9e4cb5557b7586ac071
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-4998770171994096319
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
|
||||
m_Name: BundledAssetGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 0}
|
||||
m_InternalBundleIdMode: 1
|
||||
m_Compression: 1
|
||||
m_IncludeAddressInCatalog: 1
|
||||
m_IncludeGUIDInCatalog: 1
|
||||
m_IncludeLabelsInCatalog: 1
|
||||
m_InternalIdNamingMode: 0
|
||||
m_CacheClearBehavior: 0
|
||||
m_IncludeInBuild: 1
|
||||
m_BundledAssetProviderType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_ForceUniqueProvider: 0
|
||||
m_UseAssetBundleCache: 1
|
||||
m_UseAssetBundleCrc: 1
|
||||
m_UseAssetBundleCrcForCachedBundles: 1
|
||||
m_UseUWRForLocalBundles: 0
|
||||
m_Timeout: 0
|
||||
m_ChunkedTransfer: 0
|
||||
m_RedirectLimit: -1
|
||||
m_RetryCount: 0
|
||||
m_BuildPath:
|
||||
m_Id:
|
||||
m_LoadPath:
|
||||
m_Id:
|
||||
m_BundleMode: 0
|
||||
m_AssetBundleProviderType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_BundleNaming: 0
|
||||
m_AssetLoadMode: 0
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3}
|
||||
m_Name: Packed Assets
|
||||
m_EditorClassIdentifier:
|
||||
m_SchemaObjects:
|
||||
- {fileID: -4998770171994096319}
|
||||
- {fileID: 438921025847764287}
|
||||
m_Description: Pack assets into asset bundles.
|
||||
m_Settings: {fileID: 11400000, guid: c67335a4d75941d4881a64ebedebbce8, type: 2}
|
||||
--- !u!114 &438921025847764287
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
|
||||
m_Name: ContentUpdateGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 0}
|
||||
m_StaticContent: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8b58afcc1b4e244db44625e28a47b36
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
My project/Assets/AddressableAssetsData/AssetGroups.meta
Normal file
8
My project/Assets/AddressableAssetsData/AssetGroups.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ee6e7ad669b89342a6dd8bd0dd3bf84
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
|
||||
m_Name: Built In Data
|
||||
m_EditorClassIdentifier:
|
||||
m_GroupName: Built In Data
|
||||
m_Data:
|
||||
m_SerializedData: []
|
||||
m_GUID: 1989d512082b7394d9f03cd0ea5fd1b5
|
||||
m_SerializeEntries:
|
||||
- m_GUID: Resources
|
||||
m_Address: Resources
|
||||
m_ReadOnly: 1
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: EditorSceneList
|
||||
m_Address: EditorSceneList
|
||||
m_ReadOnly: 1
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
m_ReadOnly: 1
|
||||
m_Settings: {fileID: 11400000, guid: c67335a4d75941d4881a64ebedebbce8, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas:
|
||||
- {fileID: 11400000, guid: a7177bba2e94b2a40b5302657833b7d8, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb21c9bd6efb15940aa0cc136e03ec0f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
|
||||
m_Name: Default Local Group
|
||||
m_EditorClassIdentifier:
|
||||
m_GroupName: Default Local Group
|
||||
m_Data:
|
||||
m_SerializedData: []
|
||||
m_GUID: 7a5b4d76501c82c408509719f87e537b
|
||||
m_SerializeEntries:
|
||||
- m_GUID: 7e04733ce9dab74459592d3bd99fcafd
|
||||
m_Address: FlowScope.Tests.Addressables.Text
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
m_ReadOnly: 0
|
||||
m_Settings: {fileID: 11400000, guid: c67335a4d75941d4881a64ebedebbce8, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas:
|
||||
- {fileID: 11400000, guid: 4a894c5b933ed1040b799de00906a668, type: 2}
|
||||
- {fileID: 11400000, guid: ee832a18fbe81564d9e5cb06031890c9, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad50471a1bc339946b9dd02f9fd1b735
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e16dab92ed201134eb1bdc0159aa569c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b1487f5d688e4f94f828f879d599dbdc, type: 3}
|
||||
m_Name: Built In Data_PlayerDataGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: cb21c9bd6efb15940aa0cc136e03ec0f, type: 2}
|
||||
m_IncludeResourcesFolders: 1
|
||||
m_IncludeBuildSettingsScenes: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7177bba2e94b2a40b5302657833b7d8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
|
||||
m_Name: Default Local Group_BundledAssetGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: ad50471a1bc339946b9dd02f9fd1b735, type: 2}
|
||||
m_InternalBundleIdMode: 1
|
||||
m_Compression: 1
|
||||
m_IncludeAddressInCatalog: 1
|
||||
m_IncludeGUIDInCatalog: 1
|
||||
m_IncludeLabelsInCatalog: 1
|
||||
m_InternalIdNamingMode: 0
|
||||
m_CacheClearBehavior: 0
|
||||
m_IncludeInBuild: 1
|
||||
m_BundledAssetProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
|
||||
m_ForceUniqueProvider: 0
|
||||
m_UseAssetBundleCache: 1
|
||||
m_UseAssetBundleCrc: 1
|
||||
m_UseAssetBundleCrcForCachedBundles: 1
|
||||
m_UseUWRForLocalBundles: 0
|
||||
m_Timeout: 0
|
||||
m_ChunkedTransfer: 0
|
||||
m_RedirectLimit: -1
|
||||
m_RetryCount: 0
|
||||
m_BuildPath:
|
||||
m_Id: 4be60150ce46e224586b89230ab67d48
|
||||
m_LoadPath:
|
||||
m_Id: 8dd5e21a04741aa4ab24bb52c0e3c5a3
|
||||
m_BundleMode: 0
|
||||
m_AssetBundleProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
|
||||
m_BundleNaming: 0
|
||||
m_AssetLoadMode: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee832a18fbe81564d9e5cb06031890c9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
|
||||
m_Name: Default Local Group_ContentUpdateGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: ad50471a1bc339946b9dd02f9fd1b735, type: 2}
|
||||
m_StaticContent: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a894c5b933ed1040b799de00906a668
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfb9fefe94d254d44a8f7d5f6b6d22ef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 88d21199f5d473f4db36845f2318f180, type: 3}
|
||||
m_Name: BuildScriptFastMode
|
||||
m_EditorClassIdentifier:
|
||||
instanceProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
|
||||
sceneProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca567c17e92783c4d9869e540320d76f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3e2e0ffa088c91d41a086d0b8cb16bdc, type: 3}
|
||||
m_Name: BuildScriptPackedMode
|
||||
m_EditorClassIdentifier:
|
||||
instanceProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
|
||||
sceneProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f9d8997bb36a7f44aabfe404cd182f8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ad8c280d42ee0ed41a27db23b43dd2bf, type: 3}
|
||||
m_Name: BuildScriptPackedPlayMode
|
||||
m_EditorClassIdentifier:
|
||||
instanceProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
|
||||
sceneProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e268c485b53ab6547bfc8919ae0f900d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb0e4994b34add1409fd8ccaf4a82de5, type: 3}
|
||||
m_Name: BuildScriptVirtualMode
|
||||
m_EditorClassIdentifier:
|
||||
instanceProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
|
||||
sceneProviderType:
|
||||
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c179b50ddf0f4a49ba95a61fce40d9d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
My project/Assets/AddressableAssetsData/DefaultObject.asset
Normal file
15
My project/Assets/AddressableAssetsData/DefaultObject.asset
Normal file
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3a189bb168d8d90478a09ea08c2f3d72, type: 3}
|
||||
m_Name: DefaultObject
|
||||
m_EditorClassIdentifier:
|
||||
m_AddressableAssetSettingsGuid: c67335a4d75941d4881a64ebedebbce8
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9fd621d22433a64aa0741deda630f70
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FlowScope.Resources;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
using UnityAddressables = UnityEngine.AddressableAssets.Addressables;
|
||||
|
||||
namespace FlowScope.Addressables
|
||||
@@ -13,8 +14,30 @@ namespace FlowScope.Addressables
|
||||
public async Task<T> LoadAsync<T>(string key, CancellationToken cancellationToken)
|
||||
where T : class
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var handle = UnityAddressables.LoadAssetAsync<T>(key);
|
||||
await WaitWithCancellation(handle.Task, cancellationToken);
|
||||
try
|
||||
{
|
||||
await WaitWithCancellation(handle.Task, cancellationToken);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
UnityAddressables.Release(handle);
|
||||
throw;
|
||||
}
|
||||
|
||||
if (handle.OperationException != null ||
|
||||
handle.Status != AsyncOperationStatus.Succeeded ||
|
||||
handle.Result == null)
|
||||
{
|
||||
var exception = new InvalidOperationException(
|
||||
$"Failed to load Addressables resource '{key}' as {typeof(T).Name} from backend '{Name}'.",
|
||||
handle.OperationException);
|
||||
UnityAddressables.Release(handle);
|
||||
throw exception;
|
||||
}
|
||||
|
||||
return handle.Result;
|
||||
}
|
||||
|
||||
|
||||
8
My project/Assets/FlowScope/Editor.meta
Normal file
8
My project/Assets/FlowScope/Editor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b5d64c7b9f94d1db437f60ce8944a8f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
My project/Assets/FlowScope/Editor/FlowScope.Editor.asmdef
Normal file
16
My project/Assets/FlowScope/Editor/FlowScope.Editor.asmdef
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "FlowScope.Editor",
|
||||
"rootNamespace": "FlowScope.Editor",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3ee591f10b84cf7a39d50219698312e
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
268
My project/Assets/FlowScope/Editor/FlowScopeDiagnosticsWindow.cs
Normal file
268
My project/Assets/FlowScope/Editor/FlowScopeDiagnosticsWindow.cs
Normal file
@@ -0,0 +1,268 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEditor.PackageManager;
|
||||
using UnityEditor.PackageManager.Requests;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowScope.Editor
|
||||
{
|
||||
public sealed class FlowScopeDiagnosticsWindow : EditorWindow
|
||||
{
|
||||
private const string RuntimeAsmdefPath = "Assets/FlowScope/Runtime/FlowScope.Runtime.asmdef";
|
||||
private const string AddressablesAsmdefPath = "Assets/FlowScope/Addressables/FlowScope.Addressables.asmdef";
|
||||
private const string MainMenuScenePath = "Assets/FlowScope/Samples/MainMenuP0/Scenes/MainMenuP0.unity";
|
||||
private const string MainMenuPanelPrefabPath = "Assets/FlowScope/Samples/MainMenuP0/Prefabs/MainMenuPanel.prefab";
|
||||
private const string AddressablesPackageName = "com.unity.addressables";
|
||||
|
||||
private static readonly IReadOnlyList<AssetCheck> AssetChecks = new[]
|
||||
{
|
||||
new AssetCheck("Runtime asmdef", RuntimeAsmdefPath),
|
||||
new AssetCheck("Addressables asmdef", AddressablesAsmdefPath),
|
||||
new AssetCheck("MainMenuP0 scene", MainMenuScenePath),
|
||||
new AssetCheck("MainMenuPanel prefab", MainMenuPanelPrefabPath),
|
||||
};
|
||||
|
||||
private readonly List<DiagnosticResult> _assetResults = new List<DiagnosticResult>();
|
||||
|
||||
private ListRequest _packageListRequest;
|
||||
private DiagnosticResult _addressablesPackageResult = DiagnosticResult.Pending(
|
||||
"Addressables package",
|
||||
"Package status has not been refreshed.");
|
||||
|
||||
private Vector2 _scrollPosition;
|
||||
|
||||
[MenuItem("Tools/FlowScope/Diagnostics")]
|
||||
public static void Open()
|
||||
{
|
||||
FlowScopeDiagnosticsWindow window = GetWindow<FlowScopeDiagnosticsWindow>("FlowScope Diagnostics");
|
||||
window.minSize = new Vector2(520f, 320f);
|
||||
window.RefreshAll();
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
RefreshAssetChecks();
|
||||
RefreshPackageStatus();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
EditorApplication.update -= PollPackageListRequest;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
using (new EditorGUILayout.VerticalScope())
|
||||
{
|
||||
EditorGUILayout.LabelField("FlowScope Diagnostics", EditorStyles.boldLabel);
|
||||
EditorGUILayout.HelpBox("Read-only diagnostics. This window checks project state and does not create, move, delete, or repair user assets.", MessageType.Info);
|
||||
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
if (GUILayout.Button("Refresh", GUILayout.Width(96f)))
|
||||
{
|
||||
RefreshAll();
|
||||
}
|
||||
|
||||
GUILayout.Label(
|
||||
_packageListRequest != null && !_packageListRequest.IsCompleted
|
||||
? "Refreshing package status..."
|
||||
: "Package status is complete or has not been requested.",
|
||||
EditorStyles.miniLabel);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
_scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
|
||||
DrawResult(_addressablesPackageResult);
|
||||
|
||||
foreach (DiagnosticResult result in _assetResults)
|
||||
{
|
||||
DrawResult(result);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshAll()
|
||||
{
|
||||
RefreshAssetChecks();
|
||||
RefreshPackageStatus();
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void RefreshAssetChecks()
|
||||
{
|
||||
_assetResults.Clear();
|
||||
|
||||
foreach (AssetCheck check in AssetChecks)
|
||||
{
|
||||
bool exists = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(check.Path) != null;
|
||||
_assetResults.Add(exists
|
||||
? DiagnosticResult.Pass(check.Label, check.Path)
|
||||
: DiagnosticResult.Fail(check.Label, check.Path));
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshPackageStatus()
|
||||
{
|
||||
EditorApplication.update -= PollPackageListRequest;
|
||||
|
||||
_addressablesPackageResult = DiagnosticResult.Pending(
|
||||
"Addressables package",
|
||||
"Querying com.unity.addressables through Unity Package Manager.");
|
||||
|
||||
_packageListRequest = Client.List(true);
|
||||
EditorApplication.update += PollPackageListRequest;
|
||||
}
|
||||
|
||||
private void PollPackageListRequest()
|
||||
{
|
||||
if (_packageListRequest == null || !_packageListRequest.IsCompleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EditorApplication.update -= PollPackageListRequest;
|
||||
|
||||
if (_packageListRequest.Status == StatusCode.Success)
|
||||
{
|
||||
bool found = false;
|
||||
foreach (UnityEditor.PackageManager.PackageInfo packageInfo in _packageListRequest.Result)
|
||||
{
|
||||
if (string.Equals(packageInfo.name, AddressablesPackageName, StringComparison.Ordinal))
|
||||
{
|
||||
found = true;
|
||||
_addressablesPackageResult = DiagnosticResult.Pass(
|
||||
"Addressables package",
|
||||
packageInfo.name + " " + packageInfo.version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
_addressablesPackageResult = DiagnosticResult.Fail(
|
||||
"Addressables package",
|
||||
"com.unity.addressables was not found in the current Package Manager list.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorMessage = _packageListRequest.Error != null
|
||||
? _packageListRequest.Error.message
|
||||
: "Package Manager returned an unknown error.";
|
||||
_addressablesPackageResult = DiagnosticResult.Warning("Addressables package", errorMessage);
|
||||
}
|
||||
|
||||
_packageListRequest = null;
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private static void DrawResult(DiagnosticResult result)
|
||||
{
|
||||
MessageType messageType = ToMessageType(result.Status);
|
||||
|
||||
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
GUILayout.Label(ToStatusText(result.Status), GUILayout.Width(72f));
|
||||
EditorGUILayout.LabelField(result.Label, EditorStyles.boldLabel);
|
||||
}
|
||||
|
||||
EditorGUILayout.HelpBox(result.Detail, messageType);
|
||||
}
|
||||
}
|
||||
|
||||
private static MessageType ToMessageType(DiagnosticStatus status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case DiagnosticStatus.Pass:
|
||||
return MessageType.Info;
|
||||
case DiagnosticStatus.Fail:
|
||||
return MessageType.Error;
|
||||
case DiagnosticStatus.Warning:
|
||||
return MessageType.Warning;
|
||||
default:
|
||||
return MessageType.None;
|
||||
}
|
||||
}
|
||||
|
||||
private static string ToStatusText(DiagnosticStatus status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case DiagnosticStatus.Pass:
|
||||
return "OK";
|
||||
case DiagnosticStatus.Fail:
|
||||
return "Missing";
|
||||
case DiagnosticStatus.Warning:
|
||||
return "Warning";
|
||||
default:
|
||||
return "Pending";
|
||||
}
|
||||
}
|
||||
|
||||
private readonly struct AssetCheck
|
||||
{
|
||||
public AssetCheck(string label, string path)
|
||||
{
|
||||
Label = label;
|
||||
Path = path;
|
||||
}
|
||||
|
||||
public string Label { get; }
|
||||
|
||||
public string Path { get; }
|
||||
}
|
||||
|
||||
private readonly struct DiagnosticResult
|
||||
{
|
||||
private DiagnosticResult(DiagnosticStatus status, string label, string detail)
|
||||
{
|
||||
Status = status;
|
||||
Label = label;
|
||||
Detail = detail;
|
||||
}
|
||||
|
||||
public DiagnosticStatus Status { get; }
|
||||
|
||||
public string Label { get; }
|
||||
|
||||
public string Detail { get; }
|
||||
|
||||
public static DiagnosticResult Pass(string label, string detail)
|
||||
{
|
||||
return new DiagnosticResult(DiagnosticStatus.Pass, label, detail);
|
||||
}
|
||||
|
||||
public static DiagnosticResult Fail(string label, string detail)
|
||||
{
|
||||
return new DiagnosticResult(DiagnosticStatus.Fail, label, detail);
|
||||
}
|
||||
|
||||
public static DiagnosticResult Warning(string label, string detail)
|
||||
{
|
||||
return new DiagnosticResult(DiagnosticStatus.Warning, label, detail);
|
||||
}
|
||||
|
||||
public static DiagnosticResult Pending(string label, string detail)
|
||||
{
|
||||
return new DiagnosticResult(DiagnosticStatus.Pending, label, detail);
|
||||
}
|
||||
}
|
||||
|
||||
private enum DiagnosticStatus
|
||||
{
|
||||
Pending,
|
||||
Pass,
|
||||
Warning,
|
||||
Fail,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 599ef528ec0c4331a77311f6ef7ef56b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
64
My project/Assets/FlowScope/Samples/MainMenuP0/README.md
Normal file
64
My project/Assets/FlowScope/Samples/MainMenuP0/README.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# MainMenuP0 Sample
|
||||
|
||||
## 目的
|
||||
|
||||
`MainMenuP0` 是 FlowScope 当前最小接入样例。它用于验证 P0/P1 Runtime 的推荐装配方式,而不是完整游戏模板。
|
||||
|
||||
当前样例覆盖:
|
||||
|
||||
- `GameBootstrap` 创建根 `Container`。
|
||||
- 注册 `IConfigProvider`、`IResourceService`、`ISaveService`、`IAudioService`、`UIManager`、`IUIPreloadService`、`IUIScreenNavigator`。
|
||||
- 使用 `RegisterTransient` 注册 `MainMenuFeature`。
|
||||
- 通过 `UIPreloadService` 预加载 `MainMenuPanel`。
|
||||
- 通过 `UIScreenNavigator` 打开主菜单面板。
|
||||
- 点击按钮修改 `PlayerData.Gold` 并刷新 UI。
|
||||
- `ShutdownAsync` 保存数据、关闭 `GameFlow` 并释放预加载资源。
|
||||
|
||||
## 当前路径
|
||||
|
||||
第一阶段仍保留在项目内开发模式:
|
||||
|
||||
```text
|
||||
Assets/FlowScope/Samples/MainMenuP0
|
||||
```
|
||||
|
||||
P2 第一阶段不把它移动到 `Samples~`,原因是当前 PlayMode 测试、场景引用、prefab 引用和 generated csproj 路径都依赖现有位置。等 P2 第二阶段开始本地 package 试迁移后,再把它作为候选包样例整理到:
|
||||
|
||||
```text
|
||||
Samples~/MainMenuP0
|
||||
```
|
||||
|
||||
## 如何运行
|
||||
|
||||
在 Unity 中打开:
|
||||
|
||||
```text
|
||||
Assets/FlowScope/Samples/MainMenuP0/Scenes/MainMenuP0.unity
|
||||
```
|
||||
|
||||
进入 Play Mode 后,画面应显示主菜单面板、Gold 文本和递增按钮。
|
||||
|
||||
## 验收点
|
||||
|
||||
- 首次启动显示默认 Gold。
|
||||
- 点击按钮后 Gold 文本立即递增。
|
||||
- 调用 `ShutdownAsync` 后写入 `main-menu-player` 存档。
|
||||
- 再次启动后恢复上次保存的 Gold。
|
||||
- 关闭时释放预加载资源。
|
||||
- Console 不出现未预期 Error 或 Exception。
|
||||
|
||||
## 自动化测试
|
||||
|
||||
对应 PlayMode 测试位于:
|
||||
|
||||
```text
|
||||
Assets/FlowScope/Tests/PlayMode/Samples/MainMenuP0Tests.cs
|
||||
```
|
||||
|
||||
当前测试覆盖启动可见、按钮刷新、保存恢复、资源释放、启动任务可观察以及 shutdown 失败时的 best-effort cleanup。
|
||||
|
||||
## 已知限制
|
||||
|
||||
- 样例使用 `SampleResourceBackend`,不是 Addressables 真实资源验收。
|
||||
- 样例中有运行时 fallback UI,用于避免缺引用时完全不可运行;人工验收仍应优先检查场景和 prefab 引用是否完整。
|
||||
- 当前仍处于 `Assets/FlowScope` 开发模式,不代表 package sample 已完成迁移。
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9df9d94a34fa4ec2b16df2c8cf2a651b
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,10 +1,21 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FlowScope.Addressables;
|
||||
using FlowScope.Resources;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace FlowScope.Tests.PlayMode.Resources
|
||||
{
|
||||
public sealed class AddressablesResourceBackendTests
|
||||
{
|
||||
private const string TextKey = "FlowScope.Tests.Addressables.Text";
|
||||
private const string MissingKey = "FlowScope.Tests.Addressables.Missing";
|
||||
private const string ExpectedText = "FlowScope Addressables Acceptance";
|
||||
|
||||
[Test]
|
||||
public void Name_ReturnsAddressables()
|
||||
{
|
||||
@@ -12,5 +23,149 @@ namespace FlowScope.Tests.PlayMode.Resources
|
||||
|
||||
Assert.AreEqual("Addressables", backend.Name);
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator LoadAsync_WithRealTextAssetKey_LoadsTextAsset()
|
||||
{
|
||||
var backend = new AddressablesResourceBackend();
|
||||
|
||||
TextAsset asset = null;
|
||||
yield return AwaitTask(backend.LoadAsync<TextAsset>(
|
||||
TextKey,
|
||||
CancellationToken.None), loaded => asset = loaded);
|
||||
|
||||
Assert.That(asset, Is.Not.Null);
|
||||
Assert.That(asset.text, Does.Contain(ExpectedText));
|
||||
|
||||
backend.Release(TextKey, asset);
|
||||
LogAssert.NoUnexpectedReceived();
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator AddressablesResourceService_DisposeHandleTwice_ReleasesWithoutUnexpectedLogs()
|
||||
{
|
||||
var service = new AddressablesResourceService(new AddressablesResourceBackend());
|
||||
|
||||
IResourceHandle<TextAsset> handle = null;
|
||||
yield return AwaitTask(service.LoadAsync<TextAsset>(
|
||||
TextKey,
|
||||
CancellationToken.None), loaded => handle = loaded);
|
||||
|
||||
Assert.That(handle, Is.Not.Null);
|
||||
Assert.That(handle.Asset, Is.Not.Null);
|
||||
Assert.That(handle.Asset.text, Does.Contain(ExpectedText));
|
||||
|
||||
handle.Dispose();
|
||||
handle.Dispose();
|
||||
|
||||
Assert.That(handle.IsDisposed, Is.True);
|
||||
Assert.That(handle.Asset, Is.Null);
|
||||
Assert.That(service.TryLoadCompleted<TextAsset>(TextKey, out _), Is.False);
|
||||
LogAssert.NoUnexpectedReceived();
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator LoadAsync_WhenCanceled_ThrowsOperationCanceledException()
|
||||
{
|
||||
var backend = new AddressablesResourceBackend();
|
||||
using var cancellation = new CancellationTokenSource();
|
||||
cancellation.Cancel();
|
||||
|
||||
Exception exception = null;
|
||||
yield return AwaitExpectedFailure(
|
||||
() => backend.LoadAsync<TextAsset>(TextKey, cancellation.Token),
|
||||
caught => exception = caught);
|
||||
|
||||
Assert.That(exception, Is.TypeOf<OperationCanceledException>());
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator LoadAsync_WithMissingKey_ThrowsDiagnosticException()
|
||||
{
|
||||
var backend = new AddressablesResourceBackend();
|
||||
|
||||
Exception exception = null;
|
||||
yield return AwaitExpectedFailure(
|
||||
() => backend.LoadAsync<TextAsset>(MissingKey, CancellationToken.None),
|
||||
caught => exception = caught);
|
||||
|
||||
Assert.That(exception, Is.Not.Null);
|
||||
Assert.That(exception.ToString(), Does.Contain(MissingKey));
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator LoadAsync_WithMismatchedType_ThrowsDiagnosticException()
|
||||
{
|
||||
var backend = new AddressablesResourceBackend();
|
||||
|
||||
Exception exception = null;
|
||||
yield return AwaitExpectedFailure(
|
||||
() => backend.LoadAsync<GameObject>(TextKey, CancellationToken.None),
|
||||
caught => exception = caught);
|
||||
|
||||
Assert.That(exception, Is.Not.Null);
|
||||
Assert.That(exception.ToString(), Does.Contain(TextKey));
|
||||
Assert.That(exception.ToString(), Does.Contain(nameof(GameObject)));
|
||||
}
|
||||
|
||||
private static IEnumerator AwaitTask<T>(
|
||||
Task<T> task,
|
||||
Action<T> onCompleted)
|
||||
{
|
||||
while (!task.IsCompleted)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (task.IsCanceled)
|
||||
{
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
throw task.Exception.GetBaseException();
|
||||
}
|
||||
|
||||
onCompleted(task.Result);
|
||||
}
|
||||
|
||||
private static IEnumerator AwaitExpectedFailure<T>(
|
||||
Func<Task<T>> startTask,
|
||||
Action<Exception> onException)
|
||||
{
|
||||
var ignoreFailingMessages = LogAssert.ignoreFailingMessages;
|
||||
Task<T> task = null;
|
||||
try
|
||||
{
|
||||
LogAssert.ignoreFailingMessages = true;
|
||||
task = startTask();
|
||||
|
||||
while (!task.IsCompleted)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
LogAssert.ignoreFailingMessages = ignoreFailingMessages;
|
||||
}
|
||||
|
||||
if (task.IsCanceled)
|
||||
{
|
||||
onException(new OperationCanceledException());
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
onException(task.Exception.GetBaseException());
|
||||
yield break;
|
||||
}
|
||||
|
||||
Assert.Fail("Expected Addressables load to fail.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20098efc5dc925a4194600eea4969d68
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1acac9035afee5b408d7a7d78b2a1b0a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52d2a24f37dccf346b5e0c6a34585514
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1 @@
|
||||
FlowScope Addressables Acceptance
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e04733ce9dab74459592d3bd99fcafd
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user