[Bootstrap] First go at Addressables bootsrapped objects
This commit is contained in:
8
Assets/AddressableAssetsData.meta
Normal file
8
Assets/AddressableAssetsData.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 200f4ef149cfcdd4aa613fdb7c963812
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
116
Assets/AddressableAssetsData/AddressableAssetSettings.asset
Normal file
116
Assets/AddressableAssetsData/AddressableAssetSettings.asset
Normal file
@@ -0,0 +1,116 @@
|
||||
%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: 6f3207429a65b3e4b83935ac19791077
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
m_DisableCatalogUpdateOnStart: 0
|
||||
m_InternalIdNamingMode: 0
|
||||
m_InternalBundleIdMode: 1
|
||||
m_AssetLoadMode: 0
|
||||
m_BundledAssetProviderType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_AssetBundleProviderType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_IgnoreUnsupportedFilesInBuild: 0
|
||||
m_UniqueBundleIds: 0
|
||||
m_EnableJsonCatalog: 0
|
||||
m_NonRecursiveBuilding: 1
|
||||
m_CCDEnabled: 0
|
||||
m_maxConcurrentWebRequests: 3
|
||||
m_UseUWRForLocalBundles: 0
|
||||
m_BundleTimeout: 0
|
||||
m_BundleRetryCount: 0
|
||||
m_BundleRedirectLimit: -1
|
||||
m_SharedBundleSettings: 0
|
||||
m_SharedBundleSettingsCustomGroupIndex: 0
|
||||
m_ContiguousBundles: 1
|
||||
m_StripUnityVersionFromBundleBuild: 0
|
||||
m_DisableVisibleSubAssetRepresentations: 0
|
||||
m_BuiltInBundleNaming: 0
|
||||
mBuiltInBundleCustomNaming:
|
||||
m_MonoScriptBundleNaming: 0
|
||||
m_CheckForContentUpdateRestrictionsOption: 0
|
||||
m_MonoScriptBundleCustomNaming:
|
||||
m_RemoteCatalogBuildPath:
|
||||
m_Id:
|
||||
m_RemoteCatalogLoadPath:
|
||||
m_Id:
|
||||
m_ContentStateBuildPathProfileVariableName:
|
||||
m_CustomContentStateBuildPath:
|
||||
m_ContentStateBuildPath:
|
||||
m_BuildAddressablesWithPlayerBuild: 0
|
||||
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
|
||||
m_GroupAssets:
|
||||
- {fileID: 11400000, guid: efe7e1728e73e9546ac5dfee2eff524f, type: 2}
|
||||
- {fileID: 11400000, guid: 6e4927e7e19eef34b93dc2baa9e9e8e2, type: 2}
|
||||
- {fileID: 11400000, guid: 7fcc03e584505ed4381983b6ebb1179d, type: 2}
|
||||
m_BuildSettings:
|
||||
m_LogResourceManagerExceptions: 1
|
||||
m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
|
||||
m_ProfileSettings:
|
||||
m_Profiles:
|
||||
- m_InheritedParent:
|
||||
m_Id: 231dc51041f2c424899243324453fd26
|
||||
m_ProfileName: Default
|
||||
m_Values:
|
||||
- m_Id: 080115b099a6a8e45bf3d657a5f2acc8
|
||||
m_Value: <undefined>
|
||||
- m_Id: 4e476461d74a85c4fbdbe641a8c8ea63
|
||||
m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]'
|
||||
- m_Id: 88323bf0b2ef98446961cedd6232bd47
|
||||
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
|
||||
- m_Id: c258e2bcd3e8ac742ba98f152c0e6322
|
||||
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
|
||||
- m_Id: d386d965be5b6864493d081c0b44f916
|
||||
m_Value: 'ServerData/[BuildTarget]'
|
||||
m_ProfileEntryNames:
|
||||
- m_Id: 080115b099a6a8e45bf3d657a5f2acc8
|
||||
m_Name: Remote.LoadPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 4e476461d74a85c4fbdbe641a8c8ea63
|
||||
m_Name: BuildTarget
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 88323bf0b2ef98446961cedd6232bd47
|
||||
m_Name: Local.LoadPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: c258e2bcd3e8ac742ba98f152c0e6322
|
||||
m_Name: Local.BuildPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: d386d965be5b6864493d081c0b44f916
|
||||
m_Name: Remote.BuildPath
|
||||
m_InlineUsage: 0
|
||||
m_ProfileVersion: 1
|
||||
m_LabelTable:
|
||||
m_LabelNames:
|
||||
- default
|
||||
m_SchemaTemplates: []
|
||||
m_GroupTemplateObjects:
|
||||
- {fileID: 11400000, guid: ea0a5135f5495eb4693a23d94617fe92, type: 2}
|
||||
m_InitializationObjects: []
|
||||
m_CertificateHandlerType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_ActivePlayerDataBuilderIndex: 2
|
||||
m_DataBuilders:
|
||||
- {fileID: 11400000, guid: 24c8bb7fb3e787b488bb7bc8c98894a5, type: 2}
|
||||
- {fileID: 11400000, guid: ddb5be98fa60e1e428bbcc012df42eaf, type: 2}
|
||||
- {fileID: 11400000, guid: 311e9fcab9aaf5147a450fcd5c63b6b7, type: 2}
|
||||
m_ActiveProfileId: 231dc51041f2c424899243324453fd26
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11da9bb90d9dd5848b4f7629415a6937
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/AddressableAssetsData/AssetGroupTemplates.meta
Normal file
8
Assets/AddressableAssetsData/AssetGroupTemplates.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2cbdd8a3f0f6b51408f8a5b85ad682a9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,78 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-8218240370353640469
|
||||
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
|
||||
--- !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: 1021885711071950473}
|
||||
- {fileID: -8218240370353640469}
|
||||
m_Description: Pack assets into asset bundles.
|
||||
m_Settings: {fileID: 11400000, guid: 11da9bb90d9dd5848b4f7629415a6937, type: 2}
|
||||
--- !u!114 &1021885711071950473
|
||||
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_UseDefaultSchemaSettings: 0
|
||||
m_SelectedPathPairIndex: 0
|
||||
m_BundleNaming: 0
|
||||
m_AssetLoadMode: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea0a5135f5495eb4693a23d94617fe92
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/AddressableAssetsData/AssetGroups.meta
Normal file
8
Assets/AddressableAssetsData/AssetGroups.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85c3237dce544fe46a5cd53666f7b69d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
%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: CustomBoot_Editor
|
||||
m_EditorClassIdentifier:
|
||||
m_GroupName: CustomBoot_Editor
|
||||
m_GUID: eb8a37153d819c44194f7ce97570a3d3
|
||||
m_SerializeEntries:
|
||||
- m_GUID: 5dba96293096e16419f32d83116c830a
|
||||
m_Address: CustomBootSettings_Editor
|
||||
m_ReadOnly: 1
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
m_ReadOnly: 0
|
||||
m_Settings: {fileID: 11400000, guid: 11da9bb90d9dd5848b4f7629415a6937, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas:
|
||||
- {fileID: 11400000, guid: c03cc7ecaa19a7a40b438e05b1d5a25a, type: 2}
|
||||
- {fileID: 11400000, guid: fb7e1e17d5d566a46897bb2781c274df, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fcc03e584505ed4381983b6ebb1179d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
%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: CustomBoot_Runtime
|
||||
m_EditorClassIdentifier:
|
||||
m_GroupName: CustomBoot_Runtime
|
||||
m_GUID: 2b3d7cefec0915e42be04aebf0400a56
|
||||
m_SerializeEntries:
|
||||
- m_GUID: 87c2b0f93ccbf5e44ab9545c6a6e0a30
|
||||
m_Address: CustomBootSettings_Runtime
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
m_ReadOnly: 0
|
||||
m_Settings: {fileID: 11400000, guid: 11da9bb90d9dd5848b4f7629415a6937, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas:
|
||||
- {fileID: 11400000, guid: 54df76b00cd0a934b81d6281e108ca72, type: 2}
|
||||
- {fileID: 11400000, guid: 800c3aefd258544428e741376d15f603, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efe7e1728e73e9546ac5dfee2eff524f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
%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_GUID: 6f3207429a65b3e4b83935ac19791077
|
||||
m_SerializeEntries: []
|
||||
m_ReadOnly: 0
|
||||
m_Settings: {fileID: 11400000, guid: 11da9bb90d9dd5848b4f7629415a6937, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas:
|
||||
- {fileID: 11400000, guid: 1a35037765940e748ac0ff60a7f21908, type: 2}
|
||||
- {fileID: 11400000, guid: 92c701584db72e34fb4f96ff2c315771, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e4927e7e19eef34b93dc2baa9e9e8e2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/AddressableAssetsData/AssetGroups/Schemas.meta
Normal file
8
Assets/AddressableAssetsData/AssetGroups/Schemas.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 198ac392d7a29d1468b7397c72b05cd7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
%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: CustomBoot_Editor_BundledAssetGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: 7fcc03e584505ed4381983b6ebb1179d, 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: 0
|
||||
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: c258e2bcd3e8ac742ba98f152c0e6322
|
||||
m_LoadPath:
|
||||
m_Id: 88323bf0b2ef98446961cedd6232bd47
|
||||
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_UseDefaultSchemaSettings: 0
|
||||
m_SelectedPathPairIndex: 0
|
||||
m_BundleNaming: 0
|
||||
m_AssetLoadMode: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c03cc7ecaa19a7a40b438e05b1d5a25a
|
||||
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: CustomBoot_Editor_ContentUpdateGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: 7fcc03e584505ed4381983b6ebb1179d, type: 2}
|
||||
m_StaticContent: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb7e1e17d5d566a46897bb2781c274df
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
%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: CustomBoot_Runtime_BundledAssetGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: efe7e1728e73e9546ac5dfee2eff524f, 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: c258e2bcd3e8ac742ba98f152c0e6322
|
||||
m_LoadPath:
|
||||
m_Id: 88323bf0b2ef98446961cedd6232bd47
|
||||
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_UseDefaultSchemaSettings: 0
|
||||
m_SelectedPathPairIndex: 0
|
||||
m_BundleNaming: 0
|
||||
m_AssetLoadMode: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54df76b00cd0a934b81d6281e108ca72
|
||||
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: CustomBoot_Runtime_ContentUpdateGroupSchema
|
||||
m_EditorClassIdentifier:
|
||||
m_Group: {fileID: 11400000, guid: efe7e1728e73e9546ac5dfee2eff524f, type: 2}
|
||||
m_StaticContent: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 800c3aefd258544428e741376d15f603
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
%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: 6e4927e7e19eef34b93dc2baa9e9e8e2, 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: c258e2bcd3e8ac742ba98f152c0e6322
|
||||
m_LoadPath:
|
||||
m_Id: 88323bf0b2ef98446961cedd6232bd47
|
||||
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_UseDefaultSchemaSettings: 0
|
||||
m_SelectedPathPairIndex: 0
|
||||
m_BundleNaming: 0
|
||||
m_AssetLoadMode: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a35037765940e748ac0ff60a7f21908
|
||||
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: 6e4927e7e19eef34b93dc2baa9e9e8e2, type: 2}
|
||||
m_StaticContent: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92c701584db72e34fb4f96ff2c315771
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/AddressableAssetsData/DataBuilders.meta
Normal file
8
Assets/AddressableAssetsData/DataBuilders.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16a2d6cd73e9fd7489bbbbc08e25a52e
|
||||
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: 24c8bb7fb3e787b488bb7bc8c98894a5
|
||||
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: 311e9fcab9aaf5147a450fcd5c63b6b7
|
||||
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: ddb5be98fa60e1e428bbcc012df42eaf
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
Assets/AddressableAssetsData/DefaultObject.asset
Normal file
15
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: 11da9bb90d9dd5848b4f7629415a6937
|
||||
8
Assets/AddressableAssetsData/DefaultObject.asset.meta
Normal file
8
Assets/AddressableAssetsData/DefaultObject.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae6ab785ade6a78439b79df6808becd2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Data/Bootstrap.meta
Normal file
8
Assets/Data/Bootstrap.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7719b20dc923944419dbb4cebe0c782a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Data/Bootstrap/Editor.meta
Normal file
8
Assets/Data/Bootstrap/Editor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47948b9d6cab6a14ead9d422a5630428
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
Assets/Data/Bootstrap/Editor/CustomBootSettings_Editor.asset
Normal file
15
Assets/Data/Bootstrap/Editor/CustomBootSettings_Editor.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: 6b4618adec17468d8064d6088ef8e38b, type: 3}
|
||||
m_Name: CustomBootSettings_Editor
|
||||
m_EditorClassIdentifier:
|
||||
BootPrefabs: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5dba96293096e16419f32d83116c830a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Data/Bootstrap/Runtime.meta
Normal file
8
Assets/Data/Bootstrap/Runtime.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17c063be58b92514da656cc599c574b9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: 6b4618adec17468d8064d6088ef8e38b, type: 3}
|
||||
m_Name: CustomBootSettings_Runtime
|
||||
m_EditorClassIdentifier:
|
||||
BootPrefabs: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87c2b0f93ccbf5e44ab9545c6a6e0a30
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -22,7 +22,7 @@ MonoBehaviour:
|
||||
moveSpeed: 20
|
||||
stopDistance: 0.1
|
||||
useRigidbody: 1
|
||||
defaultHoldMovementMode: 1
|
||||
defaultHoldMovementMode: 0
|
||||
followUpdateInterval: 0.1
|
||||
followerSpeedMultiplier: 1.2
|
||||
heldIconDisplayHeight: 2
|
||||
|
||||
3
Assets/Editor/Bootstrap.meta
Normal file
3
Assets/Editor/Bootstrap.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb064b88d8b44c5e8829bde51b976bb7
|
||||
timeCreated: 1757238427
|
||||
216
Assets/Editor/Bootstrap/CustomBootEditorUtils.cs
Normal file
216
Assets/Editor/Bootstrap/CustomBootEditorUtils.cs
Normal file
@@ -0,0 +1,216 @@
|
||||
using Bootstrap;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Editor.Bootstrap
|
||||
{
|
||||
/// <summary>
|
||||
/// Edit-mode utilities.
|
||||
///
|
||||
/// This class provides a handy mechanism to enable editor bootstrapping.
|
||||
/// When enabled, the bootstrap system will initialise during edit-mode, allowing
|
||||
/// developers to preview the effects of the bootstrap system.
|
||||
///
|
||||
/// There are several caveats here:
|
||||
/// 1. DontDestroyOnLoad doesn't work in edit-mode. Any objects loaded by the bootstrap system
|
||||
/// will be added to the current scene.
|
||||
/// 2. Entering playmode will cause this script to de-initialise the bootstrapper, if initialised.
|
||||
/// This means that playmode priority is always given to the boostrapper.
|
||||
/// 3. If editor bootstrapping is enabled, then the bootstrapper will de-init and re-init
|
||||
/// whenever the current scene changes. This may not be appropriate for all workflows!
|
||||
/// 4. If bootstrapping is enabled, and the current scene is saved, then the bootstrapper will be
|
||||
/// de-initialised prior to the scene being saved to disk, and then re-initialised, thereby
|
||||
/// avoiding scene pollution.
|
||||
/// </summary>
|
||||
[InitializeOnLoad]
|
||||
public static class CustomBootEditorUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor prefs key for the edit-mode bootstrapper.
|
||||
/// </summary>
|
||||
private const string INITIALISE_IN_EDITOR = "bootstrap.editor_init_enabled";
|
||||
|
||||
/// <summary>
|
||||
/// Menu path for the edit-mode bootstrapper
|
||||
/// </summary>
|
||||
private const string EDITOR_INIT_MENU = "Bootstrap/Editor Initialise";
|
||||
|
||||
static CustomBootEditorUtils()
|
||||
{
|
||||
InitPlayModeListener();
|
||||
|
||||
if (Application.isPlaying) return;
|
||||
|
||||
//Don't initialise if we're about to change playmode!
|
||||
if (EditorInitialisationEnabled && !EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
{
|
||||
DoInit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the playmode change listener.
|
||||
/// This also sets up a listener for scene saving, so that we can
|
||||
/// de-init and reinit the bootstrapper when the user saves changes, thereby
|
||||
/// avoiding bootstrapped objects polluting the saved scene.
|
||||
/// </summary>
|
||||
private static void InitPlayModeListener()
|
||||
{
|
||||
EditorApplication.playModeStateChanged += EditorApplicationOnplayModeStateChanged;
|
||||
EditorSceneManager.sceneSaving += OnSceneSaving;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle the <see cref="EditorSceneManager.sceneSaving"/> event.
|
||||
/// This de-initialises the bootstrapper, removing objects from the scene,
|
||||
/// and then listens for the <see cref="EditorSceneManager.sceneSaved"/> event
|
||||
/// in order to re-initialise the bootstrapper.
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="path"></param>
|
||||
private static void OnSceneSaving(Scene scene, string path)
|
||||
{
|
||||
if (CustomBoot.Initialised)
|
||||
{
|
||||
DoDeInit();
|
||||
EditorSceneManager.sceneSaved += EditorSceneManagerOnsceneSaved;
|
||||
|
||||
void EditorSceneManagerOnsceneSaved(Scene scene1)
|
||||
{
|
||||
EditorSceneManager.sceneSaved -= EditorSceneManagerOnsceneSaved;
|
||||
CheckInit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deinitialise the playmode change listener
|
||||
/// </summary>
|
||||
private static void DeInitPlayModeListener()
|
||||
{
|
||||
EditorApplication.playModeStateChanged -= EditorApplicationOnplayModeStateChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is play-mode bootstrapping enabled?
|
||||
/// </summary>
|
||||
private static bool EditorInitialisationEnabled
|
||||
{
|
||||
get => EditorPrefs.GetBool(INITIALISE_IN_EDITOR, false);
|
||||
set => EditorPrefs.SetBool(INITIALISE_IN_EDITOR, value);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Menu handler for the edit-mode bootstrapper
|
||||
/// </summary>
|
||||
[MenuItem(EDITOR_INIT_MENU)]
|
||||
private static void EditorInitialise()
|
||||
{
|
||||
EditorInitialisationEnabled = !EditorInitialisationEnabled;
|
||||
CheckInit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Menu validator for the edit-mode bootstrapper
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MenuItem(EDITOR_INIT_MENU, true)]
|
||||
private static bool EditorInitialiseValidate()
|
||||
{
|
||||
Menu.SetChecked(EDITOR_INIT_MENU, EditorPrefs.GetBool(INITIALISE_IN_EDITOR, false));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform initialisation or de-initialisation depending on the current context
|
||||
/// </summary>
|
||||
private static void CheckInit()
|
||||
{
|
||||
if (EditorInitialisationEnabled && !CustomBoot.Initialised && !Application.isPlaying)
|
||||
{
|
||||
DoInit();
|
||||
}
|
||||
else if (CustomBoot.Initialised)
|
||||
{
|
||||
DoDeInit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform the initialisation process.
|
||||
/// This adds a listener for the <see cref="EditorSceneManager.sceneClosing"/> event so that we
|
||||
/// can handle scene changes once we're initialised
|
||||
/// </summary>
|
||||
private static void DoInit()
|
||||
{
|
||||
EditorSceneManager.sceneClosing += OnSceneClosing;
|
||||
CustomBoot.PerformInitialisation();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle the <see cref="EditorSceneManager.sceneClosing"/> event
|
||||
/// This de-initialises the bootstrapper and then sets up a listener for the
|
||||
/// <see cref="EditorSceneManager.activeSceneChangedInEditMode"/> event so that
|
||||
/// we can safely re-initialise the bootstrapper
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="removingscene"></param>
|
||||
private static void OnSceneClosing(Scene scene, bool removingscene)
|
||||
{
|
||||
if (!Application.isPlaying && CustomBoot.Initialised)
|
||||
{
|
||||
DoDeInit();
|
||||
EditorSceneManager.activeSceneChangedInEditMode += OnSceneLoaded;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the <see cref="EditorSceneManager.activeSceneChangedInEditMode"/> event,
|
||||
/// allowing the boostrapper to reinitialise if required
|
||||
/// </summary>
|
||||
/// <param name="arg0"></param>
|
||||
/// <param name="scene"></param>
|
||||
private static void OnSceneLoaded(Scene arg0, Scene scene)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
EditorSceneManager.activeSceneChangedInEditMode -= OnSceneLoaded;
|
||||
CheckInit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// De-Initialises the bootstrapper
|
||||
/// </summary>
|
||||
private static void DoDeInit()
|
||||
{
|
||||
CustomBoot.PerformDeInitialisation();
|
||||
EditorSceneManager.sceneClosing -= OnSceneClosing;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Handles playmode change events. This will de-initialise the bootstrapper
|
||||
/// when exiting edit-mode, and call <see cref="CheckInit"/> when entering edit-mode
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
private static void EditorApplicationOnplayModeStateChanged(PlayModeStateChange obj)
|
||||
{
|
||||
switch (obj)
|
||||
{
|
||||
case PlayModeStateChange.ExitingEditMode:
|
||||
if (CustomBoot.Initialised)
|
||||
{
|
||||
DoDeInit();
|
||||
}
|
||||
break;
|
||||
case PlayModeStateChange.EnteredEditMode:
|
||||
CheckInit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Editor/Bootstrap/CustomBootEditorUtils.cs.meta
Normal file
3
Assets/Editor/Bootstrap/CustomBootEditorUtils.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2e29f8987f24903ac5e99d8c1b4f003
|
||||
timeCreated: 1731265444
|
||||
21
Assets/Editor/Bootstrap/CustomBootProjectSettings.cs
Normal file
21
Assets/Editor/Bootstrap/CustomBootProjectSettings.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Editor.Bootstrap
|
||||
{
|
||||
/// <summary>
|
||||
/// A scriptable object used to store references to CustomBoot settings for both Runtime and Editor.
|
||||
/// </summary>
|
||||
public class CustomBootProjectSettings : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The Addressables reference for the runtime settings
|
||||
/// </summary>
|
||||
public AssetReference RuntimeSettings;
|
||||
|
||||
/// <summary>
|
||||
/// The Addressables reference for the editor settings
|
||||
/// </summary>
|
||||
public AssetReference EditorSettings;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96f303d5dfe74b3ea131e7c7de54901a
|
||||
timeCreated: 1724178591
|
||||
131
Assets/Editor/Bootstrap/CustomBootSettingsProvider.cs
Normal file
131
Assets/Editor/Bootstrap/CustomBootSettingsProvider.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Bootstrap;
|
||||
using UnityEditor;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Editor.Bootstrap
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings provider for the custom boot behaviour
|
||||
/// </summary>
|
||||
public class CustomBootSettingsProvider : SettingsProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal reference to the serialized boot settings object
|
||||
/// </summary>
|
||||
private SerializedObject customBootSettings;
|
||||
|
||||
|
||||
private CustomBootSettingsProvider(string path, SettingsScope scopes = SettingsScope.Project, IEnumerable<string> keywords = null) : base(path, scopes, keywords)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the UI for the settings provider
|
||||
/// </summary>
|
||||
/// <param name="searchContext"></param>
|
||||
/// <param name="rootElement"></param>
|
||||
public override void OnActivate(string searchContext, VisualElement rootElement)
|
||||
{
|
||||
customBootSettings = CustomBootSettingsUtil.GetSerializedSettings();
|
||||
|
||||
var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Editor/StyleSheets/CustomBootStyles.uss");
|
||||
rootElement.styleSheets.Add(styleSheet);
|
||||
rootElement.AddToClassList("settings");
|
||||
var title = new Label()
|
||||
{
|
||||
text = "Custom Boot"
|
||||
};
|
||||
title.AddToClassList("title");
|
||||
rootElement.Add(title);
|
||||
|
||||
var properties = new VisualElement()
|
||||
{
|
||||
style =
|
||||
{
|
||||
flexDirection = FlexDirection.Column
|
||||
}
|
||||
};
|
||||
properties.AddToClassList("property-list");
|
||||
|
||||
var runtimeProp = customBootSettings.FindProperty(nameof(CustomBootProjectSettings.RuntimeSettings));
|
||||
var editorProp = customBootSettings.FindProperty(nameof(CustomBootProjectSettings.EditorSettings));
|
||||
|
||||
properties.Add(CreateBootSettingsEditor(runtimeProp));
|
||||
properties.Add(CreateBootSettingsEditor(editorProp));
|
||||
rootElement.Add(properties);
|
||||
|
||||
rootElement.Bind(customBootSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw an editor for the CustomBootSettings object associated with the given property
|
||||
/// </summary>
|
||||
/// <param name="property"></param>
|
||||
/// <returns></returns>
|
||||
private static VisualElement CreateBootSettingsEditor(SerializedProperty property)
|
||||
{
|
||||
var bootSettingsObject = new SerializedObject(AssetDatabase.LoadAssetAtPath<CustomBootSettings>(AssetDatabase.GUIDToAssetPath((property.boxedValue as AssetReference).AssetGUID)));
|
||||
var propertyEditorContainer = new VisualElement();
|
||||
DrawObject(propertyEditorContainer, bootSettingsObject);
|
||||
return propertyEditorContainer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generic SerializedObject property editor
|
||||
/// </summary>
|
||||
/// <param name="container"></param>
|
||||
/// <param name="o"></param>
|
||||
private static void DrawObject(VisualElement container, SerializedObject o)
|
||||
{
|
||||
var l = new Label(o.targetObject.name);
|
||||
container.Add(l);
|
||||
var f = GetVisibleSerializedFields(o.targetObject.GetType());
|
||||
foreach (var field in f)
|
||||
{
|
||||
var prop = o.FindProperty(field.Name);
|
||||
var pField = new PropertyField(prop);
|
||||
container.Add(pField);
|
||||
}
|
||||
container.Bind(o);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve all accessible serialised fields for the given type
|
||||
/// </summary>
|
||||
/// <param name="T"></param>
|
||||
/// <returns></returns>
|
||||
private static FieldInfo[] GetVisibleSerializedFields(Type T)
|
||||
{
|
||||
var publicFields = T.GetFields(BindingFlags.Instance | BindingFlags.Public);
|
||||
var infoFields = publicFields.Where(t => t.GetCustomAttribute<HideInInspector>() == null).ToList();
|
||||
|
||||
var privateFields = T.GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
infoFields.AddRange(privateFields.Where(t => t.GetCustomAttribute<SerializeField>() != null));
|
||||
|
||||
return infoFields.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the Settings Provider. Internally, this will ensure the settings object is created.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SettingsProvider]
|
||||
public static SettingsProvider CreateCustomBootSettingsProvider()
|
||||
{
|
||||
if (!CustomBootSettingsUtil.IsSettingsAvailable())
|
||||
{
|
||||
CustomBootSettingsUtil.GetOrCreateSettings();
|
||||
}
|
||||
|
||||
var provider = new CustomBootSettingsProvider("Project/Custom Boot", SettingsScope.Project);
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41cc0ad6a6e04eb4b9ebe5107f00f8b3
|
||||
timeCreated: 1724007531
|
||||
218
Assets/Editor/Bootstrap/CustomBootSettingsUtil.cs
Normal file
218
Assets/Editor/Bootstrap/CustomBootSettingsUtil.cs
Normal file
@@ -0,0 +1,218 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Bootstrap;
|
||||
using UnityEditor;
|
||||
using UnityEditor.AddressableAssets;
|
||||
using UnityEditor.AddressableAssets.Settings;
|
||||
using UnityEditor.AddressableAssets.Settings.GroupSchemas;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Editor.Bootstrap
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper methods for CustomBoot configuration
|
||||
/// </summary>
|
||||
public class CustomBootSettingsUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// Path to the ProjectSettings file
|
||||
/// </summary>
|
||||
private const string PROJECT_SETTINGS_PATH = "ProjectSettings/CustomBoot.asset";
|
||||
|
||||
/// <summary>
|
||||
/// Path to the runtime custom boot settings file
|
||||
/// </summary>
|
||||
private const string RUNTIME_CUSTOM_BOOT_SETTINGS_PATH =
|
||||
"Assets/Data/Bootstrap/Runtime/CustomBootSettings_Runtime.asset";
|
||||
|
||||
/// <summary>
|
||||
/// Path to the editor custom boot settings file
|
||||
/// </summary>
|
||||
private const string EDITOR_CUSTOM_BOOT_SETTINGS_PATH =
|
||||
"Assets/Data/Bootstrap/Editor/CustomBootSettings_Editor.asset";
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the settings asset file is available
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal static bool IsSettingsAvailable()
|
||||
{
|
||||
return File.Exists(PROJECT_SETTINGS_PATH);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the settings object if it exists, otherwise create and return it.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal static CustomBootProjectSettings GetOrCreateSettings()
|
||||
{
|
||||
CustomBootProjectSettings projectSettings;
|
||||
|
||||
//Check whether the settings file already exists
|
||||
if (IsSettingsAvailable())
|
||||
{
|
||||
//If it exists, load it
|
||||
projectSettings = InternalEditorUtility.LoadSerializedFileAndForget(PROJECT_SETTINGS_PATH).First() as
|
||||
CustomBootProjectSettings;
|
||||
}
|
||||
else
|
||||
{
|
||||
//If it doesn't exist, create a new ScriptableObject
|
||||
projectSettings = ScriptableObject.CreateInstance<CustomBootProjectSettings>();
|
||||
|
||||
//Configure the settings file
|
||||
CreateBootSettingsAssets(out var runtimeEntry, out var editorEntry);
|
||||
projectSettings.RuntimeSettings = new AssetReference(runtimeEntry.guid);
|
||||
projectSettings.EditorSettings = new AssetReference(editorEntry.guid);
|
||||
|
||||
//And save it!
|
||||
InternalEditorUtility.SaveToSerializedFileAndForget(new Object[] { projectSettings },
|
||||
PROJECT_SETTINGS_PATH, true);
|
||||
}
|
||||
|
||||
//Finally, return our settings object
|
||||
return projectSettings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the Runtime and Editor CustomBootSettings assets.
|
||||
/// </summary>
|
||||
/// <param name="runtimeEntry"></param>
|
||||
/// <param name="editorEntry"></param>
|
||||
private static void CreateBootSettingsAssets(out AddressableAssetEntry runtimeEntry,
|
||||
out AddressableAssetEntry editorEntry)
|
||||
{
|
||||
//Create two assets representing our boot configurations
|
||||
var runtimeSettings =
|
||||
GetOrCreateBootSettingsAsset(RUNTIME_CUSTOM_BOOT_SETTINGS_PATH, out var runtimeCreated);
|
||||
var editorSettings = GetOrCreateBootSettingsAsset(EDITOR_CUSTOM_BOOT_SETTINGS_PATH, out var editorCreated);
|
||||
|
||||
//Save the AssetDatabase state if either asset is new
|
||||
if (runtimeCreated || editorCreated)
|
||||
{
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
//Configure the Addressables system with the new assets.
|
||||
AddSettingsToAddressables(runtimeSettings, editorSettings, out runtimeEntry, out editorEntry);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load, or create, a CustomBootSettings asset at the given path
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="wasCreated"></param>
|
||||
/// <returns></returns>
|
||||
private static CustomBootSettings GetOrCreateBootSettingsAsset(string path, out bool wasCreated)
|
||||
{
|
||||
var settings = AssetDatabase.LoadAssetAtPath<CustomBootSettings>(path);
|
||||
if (!settings)
|
||||
{
|
||||
//Make sure full path is created
|
||||
var dirPath = Path.GetDirectoryName(path);
|
||||
if (!Directory.Exists(dirPath))
|
||||
{
|
||||
Directory.CreateDirectory(dirPath);
|
||||
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
|
||||
}
|
||||
|
||||
settings = ScriptableObject.CreateInstance<CustomBootSettings>();
|
||||
AssetDatabase.CreateAsset(settings, path);
|
||||
wasCreated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
wasCreated = false;
|
||||
}
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the CustomBootSettings asset to the relevant Addressables groups.
|
||||
/// </summary>
|
||||
/// <param name="runtimeSettings"></param>
|
||||
/// <param name="editorSettings"></param>
|
||||
/// <param name="runtimeEntry"></param>
|
||||
/// <param name="editorEntry"></param>
|
||||
private static void AddSettingsToAddressables(CustomBootSettings runtimeSettings,
|
||||
CustomBootSettings editorSettings, out AddressableAssetEntry runtimeEntry,
|
||||
out AddressableAssetEntry editorEntry)
|
||||
{
|
||||
InitialiseAddressableGroups(out var runtimeGroup, out var editorGroup);
|
||||
runtimeEntry =
|
||||
CreateCustomBootSettingsEntry(runtimeSettings, runtimeGroup, $"{nameof(CustomBootSettings)}_Runtime");
|
||||
editorEntry =
|
||||
CreateCustomBootSettingsEntry(editorSettings, editorGroup, $"{nameof(CustomBootSettings)}_Editor");
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Addressables entry for the given CustomBootSettings object, and add it to the given group.
|
||||
/// </summary>
|
||||
/// <param name="bootSettings"></param>
|
||||
/// <param name="group"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
private static AddressableAssetEntry CreateCustomBootSettingsEntry(CustomBootSettings bootSettings,
|
||||
AddressableAssetGroup group, string key)
|
||||
{
|
||||
var settings = AddressableAssetSettingsDefaultObject.Settings;
|
||||
var entry = settings.CreateOrMoveEntry(
|
||||
AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(bootSettings)),
|
||||
group);
|
||||
entry.address = key;
|
||||
settings.SetDirty(AddressableAssetSettings.ModificationEvent.EntryMoved, entry, true);
|
||||
return entry;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure the Runtime and Editor Addressables groups exist
|
||||
/// </summary>
|
||||
/// <param name="runtimeGroup"></param>
|
||||
/// <param name="editorGroup"></param>
|
||||
private static void InitialiseAddressableGroups(out AddressableAssetGroup runtimeGroup,
|
||||
out AddressableAssetGroup editorGroup)
|
||||
{
|
||||
runtimeGroup = GetOrCreateGroup($"{nameof(CustomBoot)}_Runtime", true);
|
||||
editorGroup = GetOrCreateGroup($"{nameof(CustomBoot)}_Editor", false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve or create an Addressables group.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="includeInBuild"></param>
|
||||
/// <returns></returns>
|
||||
private static AddressableAssetGroup GetOrCreateGroup(string name, bool includeInBuild)
|
||||
{
|
||||
// Use GetSettings(true) to ensure the settings asset is created if missing
|
||||
var settings = AddressableAssetSettingsDefaultObject.GetSettings(true);
|
||||
if (settings == null)
|
||||
{
|
||||
Debug.LogError("AddressableAssetSettings could not be found or created. Please ensure Addressables are set up in your project.");
|
||||
return null;
|
||||
}
|
||||
var group = settings.FindGroup(name);
|
||||
if (group == null)
|
||||
{
|
||||
group = settings.CreateGroup(name, false, false, true, settings.DefaultGroup.Schemas);
|
||||
group.GetSchema<BundledAssetGroupSchema>().IncludeInBuild = includeInBuild;
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the serialised representation of the settings object
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal static SerializedObject GetSerializedSettings()
|
||||
{
|
||||
return new SerializedObject(GetOrCreateSettings());
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Editor/Bootstrap/CustomBootSettingsUtil.cs.meta
Normal file
3
Assets/Editor/Bootstrap/CustomBootSettingsUtil.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05fc3698d2694614882942c0c41db065
|
||||
timeCreated: 1724010512
|
||||
3
Assets/Editor/StyleSheets.meta
Normal file
3
Assets/Editor/StyleSheets.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1defa1690a6b4cedb690c43f8183206a
|
||||
timeCreated: 1757241205
|
||||
9
Assets/Editor/StyleSheets/CustomBootStyles.uss
Normal file
9
Assets/Editor/StyleSheets/CustomBootStyles.uss
Normal file
@@ -0,0 +1,9 @@
|
||||
.settings {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 180%;
|
||||
-unity-font-style: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
3
Assets/Editor/StyleSheets/CustomBootStyles.uss.meta
Normal file
3
Assets/Editor/StyleSheets/CustomBootStyles.uss.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 979e3e0635064936a720875d59139fdd
|
||||
timeCreated: 1757241206
|
||||
@@ -4,7 +4,7 @@ using UnityEditor;
|
||||
namespace GogoGaga.OptimizedRopesAndCables
|
||||
{
|
||||
[CustomEditor(typeof(Rope))]
|
||||
public class RopeEditor : Editor
|
||||
public class RopeEditor : UnityEditor.Editor
|
||||
{
|
||||
private Rope component;
|
||||
private SerializedProperty startPoint;
|
||||
|
||||
3
Assets/Scripts/Bootstrap.meta
Normal file
3
Assets/Scripts/Bootstrap.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72153f2c39ad40deacd00c5caed75019
|
||||
timeCreated: 1757237591
|
||||
181
Assets/Scripts/Bootstrap/CustomBoot.cs
Normal file
181
Assets/Scripts/Bootstrap/CustomBoot.cs
Normal file
@@ -0,0 +1,181 @@
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
|
||||
namespace Bootstrap
|
||||
{
|
||||
/// <summary>
|
||||
/// Entrypoint for the Custom Boot initialisation
|
||||
/// </summary>
|
||||
public static class CustomBoot
|
||||
{
|
||||
/// <summary>
|
||||
/// Current initialisation status
|
||||
/// </summary>
|
||||
public static bool Initialised { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
// Called as soon as the game begins
|
||||
/// </summary>
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
|
||||
private static void Initialise()
|
||||
{
|
||||
//We should always clean up after Addressables, so let's take care of that immediately
|
||||
Application.quitting += ApplicationOnUnloading;
|
||||
|
||||
PerformInitialisation();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the bootstrapper
|
||||
/// </summary>
|
||||
public static void PerformInitialisation()
|
||||
{
|
||||
//In editor, perform initialisation synchronously
|
||||
if (Application.isEditor)
|
||||
{
|
||||
InitialiseBootSettingsSync();
|
||||
}
|
||||
else
|
||||
{
|
||||
//In builds, just run things asynchronously, since we can add any checks we need early on
|
||||
_ = InitialiseBootSettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called as the game is quitting, allowing for cleanup
|
||||
/// </summary>
|
||||
private static void ApplicationOnUnloading()
|
||||
{
|
||||
Application.quitting -= ApplicationOnUnloading;
|
||||
PerformDeInitialisation();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// De-Initialise the bootstrapper
|
||||
/// </summary>
|
||||
public static void PerformDeInitialisation()
|
||||
{
|
||||
Cleanup(runtimeBootSettingsHandle);
|
||||
Cleanup(editorBootSettingsHandle);
|
||||
Initialised = false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the boot settings asynchronously
|
||||
/// </summary>
|
||||
private static async Task InitialiseBootSettings()
|
||||
{
|
||||
await LoadCustomBootSettings();
|
||||
Initialised = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the boot settings synchronously
|
||||
/// </summary>
|
||||
private static void InitialiseBootSettingsSync()
|
||||
{
|
||||
LoadCustomBootSettingsSync();
|
||||
Initialised = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Clean up the boot settings
|
||||
/// </summary>
|
||||
/// <param name="handle"></param>
|
||||
private static void Cleanup(AsyncOperationHandle<CustomBootSettings> handle)
|
||||
{
|
||||
if (handle.IsValid())
|
||||
{
|
||||
handle.Result.Cleanup();
|
||||
Addressables.Release(handle);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Async handle for the runtime custom boot settings scriptable object
|
||||
/// </summary>
|
||||
private static AsyncOperationHandle<CustomBootSettings> runtimeBootSettingsHandle;
|
||||
|
||||
/// <summary>
|
||||
/// Async handle for the editor custom boot settings object
|
||||
/// </summary>
|
||||
private static AsyncOperationHandle<CustomBootSettings> editorBootSettingsHandle;
|
||||
|
||||
/// <summary>
|
||||
/// Runtime addressable key
|
||||
/// </summary>
|
||||
private static string RuntimeAsset = $"{nameof(CustomBootSettings)}_Runtime";
|
||||
|
||||
/// <summary>
|
||||
/// Editor addressable key
|
||||
/// </summary>
|
||||
private static string EditorAsset = $"{nameof(CustomBootSettings)}_Editor";
|
||||
|
||||
/// <summary>
|
||||
/// Load the custom boot settings asynchronously and run the initialisation method
|
||||
/// </summary>
|
||||
private static async Task LoadCustomBootSettings()
|
||||
{
|
||||
if (Application.isEditor)
|
||||
{
|
||||
editorBootSettingsHandle = await InitialiseBootSettingsAsset(EditorAsset);
|
||||
}
|
||||
|
||||
runtimeBootSettingsHandle = await InitialiseBootSettingsAsset(RuntimeAsset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the custom boot settings synchronously and run the initialisation method
|
||||
/// </summary>
|
||||
private static void LoadCustomBootSettingsSync()
|
||||
{
|
||||
if (Application.isEditor)
|
||||
{
|
||||
editorBootSettingsHandle = InitialiseBootSettingsAssetSync(EditorAsset);
|
||||
}
|
||||
|
||||
runtimeBootSettingsHandle = InitialiseBootSettingsAssetSync(RuntimeAsset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the boot settings asset with the given key
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
private static async Task<AsyncOperationHandle<CustomBootSettings>> InitialiseBootSettingsAsset(string key)
|
||||
{
|
||||
var handle = Addressables.LoadAssetAsync<CustomBootSettings>(key);
|
||||
await handle.Task;
|
||||
switch (handle.Status)
|
||||
{
|
||||
case AsyncOperationStatus.Failed:
|
||||
Debug.LogError(handle.OperationException);
|
||||
break;
|
||||
case AsyncOperationStatus.Succeeded:
|
||||
await handle.Result.Initialise();
|
||||
break;
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the boot settings asset with the given key synchronously
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
private static AsyncOperationHandle<CustomBootSettings> InitialiseBootSettingsAssetSync(string key)
|
||||
{
|
||||
var handle = Addressables.LoadAssetAsync<CustomBootSettings>(key);
|
||||
var result = handle.WaitForCompletion();
|
||||
result.InitialiseSync();
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Bootstrap/CustomBoot.cs.meta
Normal file
3
Assets/Scripts/Bootstrap/CustomBoot.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b562285bf55436dbf0dd87e3abcee2a
|
||||
timeCreated: 1724007283
|
||||
100
Assets/Scripts/Bootstrap/CustomBootSettings.cs
Normal file
100
Assets/Scripts/Bootstrap/CustomBootSettings.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Bootstrap
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings for the custom boot process
|
||||
/// </summary>
|
||||
public class CustomBootSettings : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of prefabs which should be loaded during boot
|
||||
/// </summary>
|
||||
public GameObject[] BootPrefabs;
|
||||
|
||||
/// <summary>
|
||||
/// Internal references to instances of the prefabs from <see cref="BootPrefabs"/>
|
||||
/// </summary>
|
||||
private GameObject[] Instances;
|
||||
|
||||
/// <summary>
|
||||
/// Runtime container object which acts as the parent for any BootPrefab instances
|
||||
/// </summary>
|
||||
private GameObject RuntimeContainer;
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the boot settings object asynchronously, loading each prefab in <see cref="BootPrefabs"/>
|
||||
/// </summary>
|
||||
public async Task Initialise()
|
||||
{
|
||||
RuntimeContainer = new GameObject($"{name}_Container");
|
||||
DontDestroyOnLoad(RuntimeContainer);
|
||||
Instances = new GameObject[BootPrefabs.Length];
|
||||
for (var i = 0; i < BootPrefabs.Length; i++)
|
||||
{
|
||||
if (!BootPrefabs[i]) continue;
|
||||
|
||||
var instance = GameObject.InstantiateAsync(BootPrefabs[i], RuntimeContainer.transform);
|
||||
while (!instance.isDone)
|
||||
await Task.Yield();
|
||||
|
||||
Instances[i] = instance.Result[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise the boot settings object synchronously, loading each prefab in <see cref="BootPrefabs"/>
|
||||
/// </summary>
|
||||
public void InitialiseSync()
|
||||
{
|
||||
RuntimeContainer = new GameObject($"{name}_Container");
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
DontDestroyOnLoad(RuntimeContainer);
|
||||
}
|
||||
|
||||
Instances = new GameObject[BootPrefabs.Length];
|
||||
for (var i = 0; i < BootPrefabs.Length; i++)
|
||||
{
|
||||
if (!BootPrefabs[i]) continue;
|
||||
|
||||
var instance = GameObject.Instantiate(BootPrefabs[i], RuntimeContainer.transform);
|
||||
Instances[i] = instance;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroy all loaded instances referenced by <see cref="Instances"/>
|
||||
/// </summary>
|
||||
public void Cleanup()
|
||||
{
|
||||
foreach (var t in Instances)
|
||||
{
|
||||
if (t)
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
GameObject.Destroy(t);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject.DestroyImmediate(t);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Instances = null;
|
||||
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
GameObject.Destroy(RuntimeContainer);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject.DestroyImmediate(RuntimeContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Bootstrap/CustomBootSettings.cs.meta
Normal file
3
Assets/Scripts/Bootstrap/CustomBootSettings.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b4618adec17468d8064d6088ef8e38b
|
||||
timeCreated: 1724007691
|
||||
@@ -2,6 +2,8 @@
|
||||
"dependencies": {
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.2d.spriteshape": "11.0.0",
|
||||
"com.unity.addressables": "2.6.0",
|
||||
"com.unity.addressables.android": "1.0.6",
|
||||
"com.unity.cinemachine": "3.1.4",
|
||||
"com.unity.feature.2d": "2.0.1",
|
||||
"com.unity.ide.rider": "3.0.36",
|
||||
|
||||
@@ -96,6 +96,32 @@
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.addressables": {
|
||||
"version": "2.6.0",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.profiling.core": "1.0.2",
|
||||
"com.unity.test-framework": "1.4.5",
|
||||
"com.unity.modules.assetbundle": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0",
|
||||
"com.unity.modules.imageconversion": "1.0.0",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.scriptablebuildpipeline": "2.4.0",
|
||||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.addressables.android": {
|
||||
"version": "1.0.6",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.addressables": "2.3.16",
|
||||
"com.unity.modules.androidjni": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.burst": {
|
||||
"version": "1.8.23",
|
||||
"depth": 2,
|
||||
@@ -189,6 +215,13 @@
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.profiling.core": {
|
||||
"version": "1.0.2",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.render-pipelines.core": {
|
||||
"version": "17.1.0",
|
||||
"depth": 1,
|
||||
@@ -232,6 +265,16 @@
|
||||
"com.unity.modules.terrain": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.scriptablebuildpipeline": {
|
||||
"version": "2.4.0",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.4.5",
|
||||
"com.unity.modules.assetbundle": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.searcher": {
|
||||
"version": "4.9.3",
|
||||
"depth": 2,
|
||||
@@ -268,7 +311,7 @@
|
||||
},
|
||||
"com.unity.test-framework": {
|
||||
"version": "1.5.1",
|
||||
"depth": 3,
|
||||
"depth": 1,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.ext.nunit": "2.0.3",
|
||||
|
||||
26
ProjectSettings/CustomBoot.asset
Normal file
26
ProjectSettings/CustomBoot.asset
Normal file
@@ -0,0 +1,26 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &1
|
||||
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: 96f303d5dfe74b3ea131e7c7de54901a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
RuntimeSettings:
|
||||
m_AssetGUID: 87c2b0f93ccbf5e44ab9545c6a6e0a30
|
||||
m_SubObjectName:
|
||||
m_SubObjectType:
|
||||
m_SubObjectGUID:
|
||||
m_EditorAssetChanged: 0
|
||||
EditorSettings:
|
||||
m_AssetGUID: 5dba96293096e16419f32d83116c830a
|
||||
m_SubObjectName:
|
||||
m_SubObjectType:
|
||||
m_SubObjectGUID:
|
||||
m_EditorAssetChanged: 0
|
||||
@@ -15,5 +15,6 @@ EditorBuildSettings:
|
||||
path: Assets/Scenes/Levels/Quarry.unity
|
||||
guid: 7826cd123499e704bbed784f37ffe300
|
||||
m_configObjects:
|
||||
com.unity.addressableassets: {fileID: 11400000, guid: ae6ab785ade6a78439b79df6808becd2, type: 2}
|
||||
com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
|
||||
m_UseUCBPForAssetBundles: 0
|
||||
|
||||
Reference in New Issue
Block a user