diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/AddressableAssetsData/AddressableAssetSettings.asset index d05e75a..aa82499 100644 --- a/Assets/AddressableAssetsData/AddressableAssetSettings.asset +++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset @@ -13,9 +13,9 @@ MonoBehaviour: m_Name: AddressableAssetSettings m_EditorClassIdentifier: m_DefaultGroup: d9910c93167875b4c99382800fc0d05e - m_CachedHash: + m_currentHash: serializedVersion: 2 - Hash: 00000000000000000000000000000000 + Hash: ea828a1e0a97826edfd1bfbc46e81fe7 m_OptimizeCatalogSize: 0 m_BuildRemoteCatalog: 0 m_BundleLocalCatalog: 0 @@ -32,17 +32,22 @@ MonoBehaviour: m_ShaderBundleNaming: 0 m_ShaderBundleCustomNaming: 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: m_GroupAssets: - {fileID: 11400000, guid: 85a41e37c6a6c344ba1b70e8e15b138f, type: 2} - {fileID: 11400000, guid: 4fa3a4f3857831f46b32fd15146ddb84, type: 2} + - {fileID: 11400000, guid: c1bd4023bac138c499ab6bc166a011cc, type: 2} + - {fileID: 11400000, guid: cbaf0f25751d5e943910fa9062905860, type: 2} m_BuildSettings: m_CompileScriptsInVirtualMode: 0 m_CleanupStreamingAssetsAfterBuilds: 1 @@ -103,3 +108,4 @@ MonoBehaviour: m_Settings: {fileID: 11400000} m_NextInstanceId: 0 m_RegisteredServiceTypeRefs: [] + m_PingTimeoutInMilliseconds: 5000 diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset index 916c008..44ab8dc 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -21,14 +21,12 @@ MonoBehaviour: m_Address: Character_P01 m_ReadOnly: 0 m_SerializedLabels: [] - - m_GUID: 1c14710c0d49c480497e5be810eb4fc4 - m_Address: Character_AddressPool_P01 - m_ReadOnly: 0 - m_SerializedLabels: [] - - m_GUID: 5fa68afe6708644fda728daf092224b3 - m_Address: Character_AddressPool_P02 + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: d0d1d00d6013742259b0519a178bae7e + m_Address: AddressGameObjectPool_2 m_ReadOnly: 0 m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 m_ReadOnly: 0 m_Settings: {fileID: 11400000, guid: e0f6fa325fd1a464cbecb4e3b9f30872, type: 2} m_SchemaSet: diff --git a/Assets/AddressableAssetsData/AssetGroups/G1.asset b/Assets/AddressableAssetsData/AssetGroups/G1.asset new file mode 100644 index 0000000..d3cabb4 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/G1.asset @@ -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: G1 + m_EditorClassIdentifier: + m_GroupName: G1 + m_Data: + m_SerializedData: [] + m_GUID: 786c82b3da1eddf4e98e44418269eaac + m_SerializeEntries: + - m_GUID: 1c14710c0d49c480497e5be810eb4fc4 + m_Address: Character_AddressPool_P01 + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 0 + m_Settings: {fileID: 11400000, guid: e0f6fa325fd1a464cbecb4e3b9f30872, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 26f22837dd630d04caec7ddac57d0d95, type: 2} + - {fileID: 11400000, guid: 45d7f078b1b138e4d8b352635c93aec1, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/G1.asset.meta b/Assets/AddressableAssetsData/AssetGroups/G1.asset.meta new file mode 100644 index 0000000..d45539f --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/G1.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c1bd4023bac138c499ab6bc166a011cc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/G2.asset b/Assets/AddressableAssetsData/AssetGroups/G2.asset new file mode 100644 index 0000000..c8f2cf6 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/G2.asset @@ -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: G2 + m_EditorClassIdentifier: + m_GroupName: G2 + m_Data: + m_SerializedData: [] + m_GUID: 0c843a54c48305444b92c07cee920462 + m_SerializeEntries: + - m_GUID: 5fa68afe6708644fda728daf092224b3 + m_Address: Character_AddressPool_P02 + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 0 + m_Settings: {fileID: 11400000, guid: e0f6fa325fd1a464cbecb4e3b9f30872, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: b6abdbd3cc0a62c4e8bb71d6d16e7306, type: 2} + - {fileID: 11400000, guid: 28bddb69006143b4f8d9adeff7301fa6, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/G2.asset.meta b/Assets/AddressableAssetsData/AssetGroups/G2.asset.meta new file mode 100644 index 0000000..83a8257 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/G2.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cbaf0f25751d5e943910fa9062905860 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..480c6c7 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_BundledAssetGroupSchema.asset @@ -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: G1_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: c1bd4023bac138c499ab6bc166a011cc, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 1 + 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: 39f5442237a26e346a93004cc38d7bf0 + m_LoadPath: + m_Id: 306e70fc82f4d384eb13742f59b5bf59 + 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: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..f29085e --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26f22837dd630d04caec7ddac57d0d95 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..b7014ff --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_ContentUpdateGroupSchema.asset @@ -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: G1_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: c1bd4023bac138c499ab6bc166a011cc, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..ae0cf2f --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G1_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 45d7f078b1b138e4d8b352635c93aec1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..29b99e5 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_BundledAssetGroupSchema.asset @@ -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: G2_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: cbaf0f25751d5e943910fa9062905860, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 1 + 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: 39f5442237a26e346a93004cc38d7bf0 + m_LoadPath: + m_Id: 306e70fc82f4d384eb13742f59b5bf59 + 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: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..7373bbe --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6abdbd3cc0a62c4e8bb71d6d16e7306 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..b917d6c --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_ContentUpdateGroupSchema.asset @@ -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: G2_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: cbaf0f25751d5e943910fa9062905860, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..3f28c15 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/G2_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28bddb69006143b4f8d9adeff7301fa6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Environment/Scripts/Grid.cs b/Assets/Environment/Scripts/Grid.cs index e9e6f55..b075ba8 100644 --- a/Assets/Environment/Scripts/Grid.cs +++ b/Assets/Environment/Scripts/Grid.cs @@ -6,7 +6,7 @@ namespace Sample.Environment { public class Grid { - private List _slots = new List(); + private readonly List _slots = new (); public Grid(int width, int height) { @@ -28,25 +28,17 @@ public Grid(int width, int height, bool odd) if (x % 2 == 0) continue; } - else - { - if (x % 2 != 0) - continue; - } - + else if (x % 2 != 0) + continue; for (int y = -height; y < height; y++) { if (odd) { if (y % 2 == 0) continue; - } - else - { - if (y % 2 != 0) - continue; - } - + } + else if (y % 2 != 0) + continue; _slots.Add(new Slot(new Vector3(x, 0, y), false)); } } @@ -56,32 +48,45 @@ public Slot GetAvailableSlot() { for (int i = 0; i < this._slots.Count; i++) { - if (!this._slots[i].isOccupied) - { - var newSlot = this._slots[i]; - newSlot.isOccupied = true; - this._slots[i] = newSlot; - return this._slots[i]; - } + if (this._slots[i].isOccupied) + continue; + var newSlot = this._slots[i]; + newSlot.isOccupied = true; + this._slots[i] = newSlot; + return this._slots[i]; } - - throw new Exception("No available slot"); + + return default; + } + + public bool TryGetAvailableSlot(out Slot slot) + { + for (int i = 0; i < this._slots.Count; i++) + { + if (this._slots[i].isOccupied) + continue; + var newSlot = this._slots[i]; + newSlot.isOccupied = true; + this._slots[i] = newSlot; + slot = this._slots[i]; + return true; + } + slot = default; + return false; } - public Slot FreeSlot(Vector3 position) + public void FreeSlot(Vector3 position) { foreach (var slot in this._slots) { - if (slot.position == position) - { - var newSlot = slot; - newSlot.isOccupied = false; - this._slots[this._slots.IndexOf(slot)] = newSlot; - return slot; - } + if (slot.position != position) + continue; + var newSlot = slot; + newSlot.isOccupied = false; + this._slots[this._slots.IndexOf(slot)] = newSlot; + return; } - - throw new Exception("No available slot"); + Debug .LogError($"Slot at position {position} not found"); } } } \ No newline at end of file diff --git a/Assets/Environment/Scripts/Slot.cs b/Assets/Environment/Scripts/Slot.cs index 82452d7..56d6b3d 100644 --- a/Assets/Environment/Scripts/Slot.cs +++ b/Assets/Environment/Scripts/Slot.cs @@ -4,23 +4,14 @@ namespace Sample.Environment { public struct Slot { + public Vector3 position; public bool isOccupied; - + public Slot(Vector3 position, bool isOccupied) { this.position = position; this.isOccupied = isOccupied; } - - public void Occupy() - { - isOccupied = true; - } - - public void Free() - { - isOccupied = false; - } } } \ No newline at end of file diff --git a/Assets/PoolSample/AddressablePools/AddressGameObjectPool_1.unity b/Assets/PoolSample/AddressablePools/AddressGameObjectPool_1.unity index dbcb81f..fab06ee 100644 --- a/Assets/PoolSample/AddressablePools/AddressGameObjectPool_1.unity +++ b/Assets/PoolSample/AddressablePools/AddressGameObjectPool_1.unity @@ -104,7 +104,7 @@ NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,7 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -128,6 +128,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 5685908662808553381, guid: bc0a642a3d8c4485fa3e2c739a4cf9c8, type: 3} @@ -179,6 +180,9 @@ PrefabInstance: value: Env objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: bc0a642a3d8c4485fa3e2c739a4cf9c8, type: 3} --- !u!1 &1962524535 GameObject: @@ -204,13 +208,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1962524535} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1962524537 MonoBehaviour: @@ -224,3 +228,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cdb23546d86448568402c2d071ea936d, type: 3} m_Name: m_EditorClassIdentifier: + _prefab: + _source: + m_AssetGUID: d313163ceba02498b974cf73b0605e8a + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + _parent: {fileID: 0} + _prePoolAmount: 0 + _assetReferenceGameObject: + m_AssetGUID: d313163ceba02498b974cf73b0605e8a + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + _sceneRef: + m_AssetGUID: d0d1d00d6013742259b0519a178bae7e + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + _spawnRadius: 20 + _spawnCount: 100 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 572524172} + - {fileID: 1962524536} diff --git a/Assets/PoolSample/AddressablePools/Prefabs/Character_AddressPool_P01.prefab b/Assets/PoolSample/AddressablePools/Prefabs/Character_AddressPool_P01.prefab index bf96fe0..f0f2c1b 100644 --- a/Assets/PoolSample/AddressablePools/Prefabs/Character_AddressPool_P01.prefab +++ b/Assets/PoolSample/AddressablePools/Prefabs/Character_AddressPool_P01.prefab @@ -24,13 +24,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 138330896580303601} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1206049215986293514} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &1876880627608008340 SkinnedMeshRenderer: @@ -163,13 +163,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 226250982463271441} + serializedVersion: 2 m_LocalRotation: {x: 2.3129124e-18, y: -0.7257409, z: -2.3129124e-18, w: 0.6879682} m_LocalPosition: {x: -0.2914453, y: 8.946976e-13, z: -2.131628e-15} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8531396079878343762} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &287753642208092652 GameObject: @@ -194,6 +194,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 287753642208092652} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.09367575, w: 0.9956028} m_LocalPosition: {x: -0.28033707, y: 4.973799e-16, z: -9.895423e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -201,7 +202,6 @@ Transform: m_Children: - {fileID: 7109230986068702383} m_Father: {fileID: 2327371354313371515} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &455465716626962545 GameObject: @@ -226,6 +226,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 455465716626962545} + serializedVersion: 2 m_LocalRotation: {x: 0.20964532, y: -0.0013932837, z: 0.97775495, w: -0.0064980704} m_LocalPosition: {x: -0.12041652, y: 0.0049800063, z: 0.08191209} m_LocalScale: {x: 1, y: 1, z: 1} @@ -233,7 +234,6 @@ Transform: m_Children: - {fileID: 6784831572693372801} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &488199171439605489 GameObject: @@ -258,6 +258,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 488199171439605489} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.0670836, w: 0.99774736} m_LocalPosition: {x: -0.30618182, y: -6.0396133e-16, z: 8.413475e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -273,7 +274,6 @@ Transform: - {fileID: 1716483456479881960} - {fileID: 5426280670556242380} m_Father: {fileID: 863968998202755581} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &698436440287394580 GameObject: @@ -298,13 +298,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 698436440287394580} + serializedVersion: 2 m_LocalRotation: {x: -0.018653171, y: -0.018653171, z: 0.7068607, w: 0.7068607} m_LocalPosition: {x: -0.018659646, y: 0.0832196, z: -0.0010736184} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8082933049513224970} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &714991354291320810 GameObject: @@ -329,6 +329,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 714991354291320810} + serializedVersion: 2 m_LocalRotation: {x: 2.2397977e-18, y: 5.568265e-17, z: -0.10232073, w: 0.99475145} m_LocalPosition: {x: -0.14028804, y: 0.0061973166, z: 2.2516412e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -337,7 +338,6 @@ Transform: - {fileID: 8280717662683578009} - {fileID: 2824468195007885066} m_Father: {fileID: 3021292840473646586} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &859208988865393670 GameObject: @@ -362,6 +362,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 859208988865393670} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.43467525, z: -0, w: 0.9005873} m_LocalPosition: {x: -0.21829395, y: -7.105427e-17, z: 1.4210854e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -369,7 +370,6 @@ Transform: m_Children: - {fileID: 7033026291598922017} m_Father: {fileID: 7153945816541528113} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1050784358429973911 GameObject: @@ -394,13 +394,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1050784358429973911} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.27836862, y: -0.14700456, z: 0.0005698343} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7538635978781088124} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1114744663058868659 GameObject: @@ -425,6 +425,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1114744663058868659} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -432,7 +433,6 @@ Transform: m_Children: - {fileID: 3021292840473646586} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1141075905393938299 GameObject: @@ -457,13 +457,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1141075905393938299} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.24130988, y: 0.13323241, z: -0.0005894659} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7538635978781088124} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1504218546410239170 GameObject: @@ -488,6 +488,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1504218546410239170} + serializedVersion: 2 m_LocalRotation: {x: -1.3548951e-16, y: 4.5886806e-17, z: -0.08148055, w: 0.99667495} m_LocalPosition: {x: -0.14891407, y: 1.2434498e-16, z: 4.8846454e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -497,7 +498,6 @@ Transform: - {fileID: 7554977265215205441} - {fileID: 863968998202755581} m_Father: {fileID: 2824468195007885066} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1549371409795741819 GameObject: @@ -522,6 +522,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1549371409795741819} + serializedVersion: 2 m_LocalRotation: {x: 1.00992795e-29, y: 2.648741e-28, z: 0.03987671, w: 0.99920464} m_LocalPosition: {x: 0.35891908, y: 1.5543122e-17, z: 1.4210854e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -529,7 +530,6 @@ Transform: m_Children: - {fileID: 7538635978781088124} m_Father: {fileID: 7478584122703587002} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1627694566779018130 GameObject: @@ -554,6 +554,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1627694566779018130} + serializedVersion: 2 m_LocalRotation: {x: -0.05363183, y: 0.00061813387, z: 0.022184182, w: 0.99831414} m_LocalPosition: {x: 0.25370672, y: -0.010923628, z: 0.0016361566} m_LocalScale: {x: 1, y: 1, z: 1} @@ -561,7 +562,6 @@ Transform: m_Children: - {fileID: 668438987156427820} m_Father: {fileID: 2272526423318546737} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1679905956533328033 GameObject: @@ -586,13 +586,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1679905956533328033} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.27837098, y: 0.14700453, z: -0.00056984223} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1812620905285711470} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1802479053495865607 GameObject: @@ -617,13 +617,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1802479053495865607} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.06756819, w: 0.99771464} m_LocalPosition: {x: -0.30677703, y: 0.011362112, z: -3.952184e-17} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7109230986068702383} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1929923597870699303 GameObject: @@ -648,6 +648,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1929923597870699303} + serializedVersion: 2 m_LocalRotation: {x: 0.08801344, y: 0.7016079, z: 0.08801344, w: 0.7016079} m_LocalPosition: {x: -3.0999767e-32, y: -0.0007635658, z: 0.46243998} m_LocalScale: {x: 1, y: 1, z: 1} @@ -658,7 +659,6 @@ Transform: - {fileID: 2272526423318546737} - {fileID: 921109918825724116} m_Father: {fileID: 750084520247354679} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2032261819383484458 GameObject: @@ -683,13 +683,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2032261819383484458} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.28746313, z: -0, w: 0.95779175} m_LocalPosition: {x: -0.35610884, y: 2.8398991e-31, z: -1.4210854e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6145952056201830785} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2507900356367636727 GameObject: @@ -714,6 +714,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2507900356367636727} + serializedVersion: 2 m_LocalRotation: {x: -0.031930987, y: 0.077209614, z: 0.98761743, w: 0.13278146} m_LocalPosition: {x: 0.022657752, y: -0.0018067972, z: 0.17085} m_LocalScale: {x: 1, y: 1, z: 1} @@ -721,7 +722,6 @@ Transform: m_Children: - {fileID: 420675736411534631} m_Father: {fileID: 3021292840473646586} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2532881563549839027 GameObject: @@ -746,13 +746,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2532881563549839027} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.11008295, y: -0.009449474, z: 0.0006042766} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1812620905285711470} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2643011505494255503 GameObject: @@ -777,6 +777,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2643011505494255503} + serializedVersion: 2 m_LocalRotation: {x: -0.0013932837, y: -0.20964532, z: 0.0064980704, w: 0.97775495} m_LocalPosition: {x: -0.120417975, y: 0.0049800063, z: -0.081912056} m_LocalScale: {x: 1, y: 1, z: 1} @@ -784,7 +785,6 @@ Transform: m_Children: - {fileID: 283173838363886958} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2713646055767526605 GameObject: @@ -809,13 +809,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2713646055767526605} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.5431475, z: -0, w: 0.8396373} m_LocalPosition: {x: -0.67569554, y: -2.8865798e-17, z: -5.684342e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6670808628360169920} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2843460156077627762 GameObject: @@ -840,6 +840,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2843460156077627762} + serializedVersion: 2 m_LocalRotation: {x: 0.07721848, y: 0.0319301, z: -0.13278173, w: 0.9876167} m_LocalPosition: {x: 0.022657402, y: -0.0018067064, z: -0.17085041} m_LocalScale: {x: 1, y: 1, z: 1} @@ -847,7 +848,6 @@ Transform: m_Children: - {fileID: 5975660448523642792} m_Father: {fileID: 3021292840473646586} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3420775065772691144 GameObject: @@ -872,6 +872,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3420775065772691144} + serializedVersion: 2 m_LocalRotation: {x: 1.485756e-30, y: 5.747986e-29, z: 0.03987671, w: 0.99920464} m_LocalPosition: {x: -0.35891947, y: -6.661338e-18, z: -4.2632563e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -879,7 +880,6 @@ Transform: m_Children: - {fileID: 1812620905285711470} m_Father: {fileID: 1205495623789889750} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3583981249486399142 GameObject: @@ -905,13 +905,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3583981249486399142} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8073424196381629842} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &567454439128644213 SkinnedMeshRenderer: @@ -1044,6 +1044,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3603544498873252484} + serializedVersion: 2 m_LocalRotation: {x: 0.72198325, y: 0.03173624, z: 0.67331934, w: -0.15612186} m_LocalPosition: {x: -0.06351176, y: 0.030065548, z: 0.20842399} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1051,7 +1052,6 @@ Transform: m_Children: - {fileID: 7478584122703587002} m_Father: {fileID: 7896211863139388261} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3630709394180804763 GameObject: @@ -1076,6 +1076,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3630709394180804763} + serializedVersion: 2 m_LocalRotation: {x: 0.47399396, y: 5.5526276e-16, z: 0.88052815, w: -1.0314995e-15} m_LocalPosition: {x: 0.06945347, y: 0.0049800063, z: 0.235986} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1083,7 +1084,6 @@ Transform: m_Children: - {fileID: 5737231255890581570} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3803429104794297356 GameObject: @@ -1108,6 +1108,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3803429104794297356} + serializedVersion: 2 m_LocalRotation: {x: -0.019583104, y: -0.014337628, z: -0.016081654, w: 0.9995761} m_LocalPosition: {x: 0.15340362, y: 0.01794422, z: -0.0011433699} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1115,7 +1116,6 @@ Transform: m_Children: - {fileID: 3945426546291992806} m_Father: {fileID: 5975660448523642792} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4115995605409072671 GameObject: @@ -1140,6 +1140,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4115995605409072671} + serializedVersion: 2 m_LocalRotation: {x: -0.3024084, y: 0.95317847, z: 6.7676127e-16, w: -2.7212164e-16} m_LocalPosition: {x: -0.030352466, y: 0.25417748, z: 2.7145378e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1147,7 +1148,6 @@ Transform: m_Children: - {fileID: 2187775998403471798} m_Father: {fileID: 3021292840473646586} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4268021608341189657 GameObject: @@ -1160,6 +1160,7 @@ GameObject: - component: {fileID: 3490535618095509155} - component: {fileID: 4033649509468943910} - component: {fileID: 903822165} + - component: {fileID: 7039333522338043405} m_Layer: 0 m_Name: Character_AddressPool_P01 m_TagString: Untagged @@ -1174,6 +1175,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4268021608341189657} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1188,7 +1190,6 @@ Transform: - {fileID: 750084520247354679} - {fileID: 8073424196381629842} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &4033649509468943910 Animator: @@ -1210,6 +1211,7 @@ Animator: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 --- !u!65 &903822165 BoxCollider: m_ObjectHideFlags: 0 @@ -1218,11 +1220,32 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4268021608341189657} m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 m_IsTrigger: 0 + m_ProvidesContacts: 0 m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_Size: {x: 1, y: 1.6, z: 1} m_Center: {x: 0, y: 0.8, z: 0} +--- !u!114 &7039333522338043405 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4268021608341189657} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ccfd0da2bab4198bf7a2413d826a967, type: 3} + m_Name: + m_EditorClassIdentifier: + _lifeTime: 2 --- !u!1 &4283619346492918992 GameObject: m_ObjectHideFlags: 0 @@ -1246,6 +1269,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4283619346492918992} + serializedVersion: 2 m_LocalRotation: {x: -0.05363183, y: 0.00061813387, z: 0.022184182, w: 0.99831414} m_LocalPosition: {x: -0.25370672, y: 0.010923714, z: -0.0016354381} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1253,7 +1277,6 @@ Transform: m_Children: - {fileID: 8082933049513224970} m_Father: {fileID: 921109918825724116} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4424136353415040355 GameObject: @@ -1278,13 +1301,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4424136353415040355} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0.7071068, z: 0, w: 0.7071068} m_LocalPosition: {x: 0.16025886, y: 0.020835321, z: 1.5729948e-18} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2882362028944447721} - m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4639378322033702546 GameObject: @@ -1309,6 +1332,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4639378322033702546} + serializedVersion: 2 m_LocalRotation: {x: -0.7056592, y: 0.014749782, z: -0.0129053835, w: 0.7082804} m_LocalPosition: {x: 0.40930742, y: 4.440892e-18, z: -7.1054274e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1319,7 +1343,6 @@ Transform: - {fileID: 5892047406499915741} - {fileID: 2434394716824458521} m_Father: {fileID: 7195090757511394589} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4692713380248173046 GameObject: @@ -1344,6 +1367,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4692713380248173046} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1351,7 +1375,6 @@ Transform: m_Children: - {fileID: 228228637039729191} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4701507429529918184 GameObject: @@ -1376,6 +1399,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4701507429529918184} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.43467525, z: -0, w: 0.9005873} m_LocalPosition: {x: 0.21829534, y: -0.0000002822668, z: -0.0000019725908} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1383,7 +1407,6 @@ Transform: m_Children: - {fileID: 7500284451345412696} m_Father: {fileID: 80097259736002229} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4718454532800291202 GameObject: @@ -1408,6 +1431,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4718454532800291202} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1415,7 +1439,6 @@ Transform: m_Children: - {fileID: 2201632628865876993} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4817060318934790676 GameObject: @@ -1441,13 +1464,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4817060318934790676} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6500139712878797334} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &1310368571816120189 SkinnedMeshRenderer: @@ -1580,6 +1603,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5083488943237554619} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1587,7 +1611,6 @@ Transform: m_Children: - {fileID: 6526375789445201083} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5111183543478305989 GameObject: @@ -1612,13 +1635,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5111183543478305989} + serializedVersion: 2 m_LocalRotation: {x: 0.5415089, y: 0.45471767, z: 0.5415089, w: -0.45471767} m_LocalPosition: {x: -0.1039998, y: -0.006094659, z: -1.09662166e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6711860330090213021} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5159717039236245029 GameObject: @@ -1643,6 +1666,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5159717039236245029} + serializedVersion: 2 m_LocalRotation: {x: -0.7056592, y: 0.014749782, z: -0.0129053835, w: 0.7082804} m_LocalPosition: {x: -0.40930396, y: -2.842171e-16, z: 2.2737367e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1653,7 +1677,6 @@ Transform: - {fileID: 8554790566202856765} - {fileID: 1167101034371147920} m_Father: {fileID: 3173945538790593745} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5233688159518383750 GameObject: @@ -1678,6 +1701,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5233688159518383750} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1685,7 +1709,6 @@ Transform: m_Children: - {fileID: 5271289200934064066} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5269846092593865583 GameObject: @@ -1711,13 +1734,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5269846092593865583} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4515168733536942268} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &1145621938648953583 SkinnedMeshRenderer: @@ -1850,6 +1873,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5587478901108345050} + serializedVersion: 2 m_LocalRotation: {x: 0.0015542243, y: 0.022218248, z: -0.11379966, w: 0.993254} m_LocalPosition: {x: -0.1541595, y: -2.664535e-16, z: -2.131628e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1857,7 +1881,6 @@ Transform: m_Children: - {fileID: 3173945538790593745} m_Father: {fileID: 4462894962888916735} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5590637880744520908 GameObject: @@ -1883,13 +1906,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5590637880744520908} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7977154252773851303} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &3691570734654701062 SkinnedMeshRenderer: @@ -2022,13 +2045,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5707481856367446099} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.13957767, y: -0.0022430373, z: 0.00047288262} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1812620905285711470} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5764652118192804511 GameObject: @@ -2053,6 +2076,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5764652118192804511} + serializedVersion: 2 m_LocalRotation: {x: 0.0015542243, y: 0.022218248, z: -0.11379966, w: 0.993254} m_LocalPosition: {x: 0.15415917, y: 0.00000004352324, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2060,7 +2084,6 @@ Transform: m_Children: - {fileID: 7195090757511394589} m_Father: {fileID: 7554977265215205441} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5788336186966367919 GameObject: @@ -2085,6 +2108,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5788336186966367919} + serializedVersion: 2 m_LocalRotation: {x: 6.142407e-17, y: 1.655707e-16, z: -0.0765332, w: 0.99706703} m_LocalPosition: {x: -0.15357347, y: -3.6637358e-17, z: 4.178964e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2092,7 +2116,6 @@ Transform: m_Children: - {fileID: 7896211863139388261} m_Father: {fileID: 3343182092621812688} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6066855096617392838 GameObject: @@ -2117,6 +2140,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6066855096617392838} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2124,7 +2148,6 @@ Transform: m_Children: - {fileID: 119567693795888709} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6170896697531000994 GameObject: @@ -2149,6 +2172,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6170896697531000994} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.47399396, z: -0, w: 0.88052815} m_LocalPosition: {x: 0.06945152, y: 0.0049800063, z: -0.2359865} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2156,7 +2180,6 @@ Transform: m_Children: - {fileID: 5617441830511941826} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6446345808013169856 GameObject: @@ -2181,6 +2204,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6446345808013169856} + serializedVersion: 2 m_LocalRotation: {x: 0.03173624, y: -0.72198325, z: 0.15612186, w: 0.67331934} m_LocalPosition: {x: -0.063511945, y: 0.030065516, z: -0.20842351} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2188,7 +2212,6 @@ Transform: m_Children: - {fileID: 1205495623789889750} m_Father: {fileID: 7896211863139388261} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6744019224384860890 GameObject: @@ -2213,13 +2236,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6744019224384860890} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.5431475, z: -0, w: 0.8396373} m_LocalPosition: {x: 0.67569244, y: 0.000000046456332, z: 0.000001032785} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6719809345154168994} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6808674702210550146 GameObject: @@ -2245,13 +2268,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6808674702210550146} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6142648240148854792} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &8032734649195767439 SkinnedMeshRenderer: @@ -2384,13 +2407,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6922517017255397821} + serializedVersion: 2 m_LocalRotation: {x: 0.004463791, y: -0.7070927, z: 0.004463791, w: 0.7070927} m_LocalPosition: {x: -0.6819025, y: -0.00860988, z: 7.8409694e-17} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4909785548142953856} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7063172531990631227 GameObject: @@ -2415,13 +2438,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7063172531990631227} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.13957906, y: 0.0022421728, z: -0.00047287406} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7538635978781088124} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7149982063308821801 GameObject: @@ -2446,13 +2469,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7149982063308821801} + serializedVersion: 2 m_LocalRotation: {x: 2.3129124e-18, y: -0.7257409, z: -2.3129124e-18, w: 0.6879682} m_LocalPosition: {x: 0.29144114, y: 0.00000043365793, z: -0.00000014326524} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2926320213317427512} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7684779052209821285 GameObject: @@ -2477,6 +2500,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7684779052209821285} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2484,7 +2508,6 @@ Transform: m_Children: - {fileID: 7719620923427115511} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7754637199560309470 GameObject: @@ -2509,6 +2532,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7754637199560309470} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2516,7 +2540,6 @@ Transform: m_Children: - {fileID: 5937915795577801586} m_Father: {fileID: 3490535618095509155} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7762759151279305076 GameObject: @@ -2541,6 +2564,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7762759151279305076} + serializedVersion: 2 m_LocalRotation: {x: -2.7535306e-17, y: -3.897205e-18, z: 0.20162798, w: 0.9794622} m_LocalPosition: {x: -0.20905116, y: 1.7763567e-16, z: 1.0606601e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2548,7 +2572,6 @@ Transform: m_Children: - {fileID: 2882362028944447721} m_Father: {fileID: 7896211863139388261} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7794991725766163678 GameObject: @@ -2573,6 +2596,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7794991725766163678} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.006312754, w: 0.9999801} m_LocalPosition: {x: -0.18918252, y: 0.0049800063, z: 1.1443254e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2580,7 +2604,6 @@ Transform: m_Children: - {fileID: 1155972674449271357} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7910800774690219132 GameObject: @@ -2605,13 +2628,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7910800774690219132} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.110078454, y: 0.009448838, z: -0.0006042899} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7538635978781088124} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7992483945061454146 GameObject: @@ -2636,6 +2659,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7992483945061454146} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0.76580924, w: 0.6430679} m_LocalPosition: {x: 0.11468992, y: -0.11381889, z: -1.1558126e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2643,7 +2667,6 @@ Transform: m_Children: - {fileID: 4425924654405568705} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8091743642228453956 GameObject: @@ -2668,6 +2691,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8091743642228453956} + serializedVersion: 2 m_LocalRotation: {x: 0.40998435, y: 0.019879602, z: 0.9108058, w: -0.044163775} m_LocalPosition: {x: -0.016146528, y: 0.0049800063, z: 0.207973} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2675,7 +2699,6 @@ Transform: m_Children: - {fileID: 2926320213317427512} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8199562350594480232 GameObject: @@ -2701,13 +2724,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8199562350594480232} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8759273347186801075} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &7846209212776854146 SkinnedMeshRenderer: @@ -2840,6 +2863,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8204447360954277264} + serializedVersion: 2 m_LocalRotation: {x: -0.019574154, y: -0.01433758, z: -0.016081778, w: 0.9995763} m_LocalPosition: {x: -0.15340334, y: -0.017944258, z: 0.001143231} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2847,7 +2871,6 @@ Transform: m_Children: - {fileID: 5000632246707600923} m_Father: {fileID: 420675736411534631} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8366429916056520271 GameObject: @@ -2872,13 +2895,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8366429916056520271} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.28746313, z: -0, w: 0.95779175} m_LocalPosition: {x: 0.35611197, y: 3.100587e-17, z: -0.0000042392044} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1716483456479881960} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8452615318620168085 GameObject: @@ -2903,13 +2926,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8452615318620168085} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.24131815, y: -0.13323142, z: 0.0005894331} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1812620905285711470} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8457796172106953154 GameObject: @@ -2934,13 +2957,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8457796172106953154} + serializedVersion: 2 m_LocalRotation: {x: -0.015762473, y: -0.7069311, z: -0.015762473, w: 0.7069311} m_LocalPosition: {x: 0.004094967, y: -0.27914742, z: -2.8367557e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3343182092621812688} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8794922878653033462 GameObject: @@ -2965,6 +2988,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8794922878653033462} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.09853762, w: 0.99513334} m_LocalPosition: {x: -0.30899003, y: 7.105427e-17, z: -7.424184e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2972,7 +2996,6 @@ Transform: m_Children: - {fileID: 3480807667522060672} m_Father: {fileID: 2187775998403471798} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9020965509426264544 GameObject: @@ -2997,13 +3020,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9020965509426264544} + serializedVersion: 2 m_LocalRotation: {x: -0.018653171, y: -0.018653171, z: 0.7068607, w: 0.7068607} m_LocalPosition: {x: 0.018659662, y: -0.08321956, z: 0.0010733596} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 668438987156427820} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9037692245517675030 GameObject: @@ -3028,6 +3051,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9037692245517675030} + serializedVersion: 2 m_LocalRotation: {x: 0.019879602, y: -0.40998435, z: 0.044163775, w: 0.9108058} m_LocalPosition: {x: -0.016145382, y: 0.0049800063, z: -0.20797296} m_LocalScale: {x: 1, y: 1, z: 1} @@ -3035,5 +3059,4 @@ Transform: m_Children: - {fileID: 8531396079878343762} m_Father: {fileID: 2882362028944447721} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample1.cs b/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample1.cs index 7f73555..05dd89c 100644 --- a/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample1.cs +++ b/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample1.cs @@ -1,98 +1,75 @@ -using System; using Cysharp.Threading.Tasks; using UnityEngine; +using UnityEngine.AddressableAssets; using ZBase.Collections.Pooled.Generic; -using ZBase.Foundation.Pooling; using ZBase.Foundation.Pooling.AddressableAssets; -using Grid = Sample.Environment.Grid; +using ZBase.Foundation.Pooling.GameObjectItem.LazyPool.Extensions; namespace Pooling.Sample { public class AddressableGameObjectPoolSample1 : MonoBehaviour { - private const string K_CHARACTER01_KEY = "Character_AddressPool_P01"; + [SerializeField] private AssetRefGameObjectPrefab _prefab; + [SerializeField] private AssetReferenceGameObject _assetReferenceGameObject; - private Grid _grid = new Grid(20, 15, true); - private List _spawned = new List(); - private void Start() - { - var pool = SharedPool.Of(); - pool.Prefab = new AddressGameObjectPrefab { - Source = K_CHARACTER01_KEY, - Parent = transform - }; - } + private GameObject _item; - private async void OnGUI() + private async UniTask Spawn() { - if (GUI.Button(new Rect(10, 10, 150, 50), "Spawn")) - { - for (int i = 0; i < 100; i++) - { - Spawn().Forget(); - } - Debug.Log("Spawn 100 item from the AddressableGameObject pool"); - } - - if (GUI.Button(new Rect(10, 70, 150, 50), "Spawn Disposable Item")) - { - await SpawnDisposableItems(); - Debug.Log("Item automatically returned to pool when context is disposed"); - } - - if (GUI.Button(new Rect(10, 130, 150, 50), "Return")) - { - Return(); - Debug.Log("Return all item to the pool"); - } - - if (GUI.Button(new Rect(10, 190, 150, 50), "Release All")) - { - ReleaseAll(); - Debug.Log("Release all item from the pool"); - } - } + _item = await LazyAssetRefGameObjectPool.Rent(_prefab); + _item.SetActive(true); + var pos = Random.insideUnitCircle * _spawnRadius; + _item.transform.position = new Vector3 {x = pos.x, y = 0, z = pos.y}; + _spawned.Add(_item); + } - private async UniTask Spawn() + private async UniTask SpawnByRef() { - var pool = SharedPool.Of(); - var go = await pool.Rent(); - go.transform.position = _grid.GetAvailableSlot().position; - go.SetActive(true); - _spawned.Add(go); - } + _item = await LazyAssetRefGameObjectPool.Rent(_assetReferenceGameObject); + _item.SetActive(true); + var pos = Random.insideUnitCircle * _spawnRadius; + _item.transform.position = new Vector3 {x = pos.x, y = 0, z = pos.y}; + _spawned.Add(_item); + } + + private void DeSpawn() => LazyAssetRefGameObjectPool.Return(_item); private void Return() { - var pool = SharedPool.Of(); foreach (var go in _spawned) { - pool.Return(go); - this._grid.FreeSlot(go.transform.position); + go.SetActive(false); + LazyAssetRefGameObjectPool.Return(go); } + _spawned.Clear(); } - - private async UniTask SpawnDisposableItems() - { - var pool = SharedPool.Of(); - var context = pool.DisposableContext(); - using var go = await context.Rent(); - go.Instance.transform.position = _grid.GetAvailableSlot().position; - go.Instance.SetActive(true); - _spawned.Add(go.Instance); - await UniTask.Delay(1500); - } - + private void ReleaseAll() { - var pool = SharedPool.Of(); - pool.ReleaseInstances(0); + foreach (var go in _spawned) + go.SetActive(false); + LazyAssetRefGameObjectPool.ReleaseInstances(0); _spawned.Clear(); } - - private void OnDisable() + + private void OnGUI() { - ReleaseAll(); + if (GUI.Button(new Rect(10, 10, 150, 50), "Spawn")) + for (int i = 0; i < _spawnCount; i++) + Spawn().Forget(); + if (GUI.Button(new Rect(10, 70, 150, 50), "Return")) + Return(); + if (GUI.Button(new Rect(10, 130, 150, 50), "Release All")) + ReleaseAll(); + if (GUI.Button(new Rect(10, 190, 150, 50), "Load By AssetRef")) + for (int i = 0; i < this._spawnCount; i++) + SpawnByRef().Forget(); + if (GUI.Button(new Rect(10, 250, 150, 50), "Switch Scene")) + Addressables.LoadSceneAsync(_sceneRef); } + [SerializeField] private AssetReference _sceneRef; + [SerializeField] private float _spawnRadius = 20f; + [SerializeField] private int _spawnCount = 20; + private readonly List _spawned = new(); } } \ No newline at end of file diff --git a/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample2.cs b/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample2.cs index 9030d7d..2dfc6f2 100644 --- a/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample2.cs +++ b/Assets/PoolSample/AddressablePools/Scripts/AddressableGameObjectPoolSample2.cs @@ -12,22 +12,23 @@ public class AddressableGameObjectPoolSample2 : MonoBehaviour private const string K_CHARACTER02_KEY = "Character_AddressPool_P02"; private Grid _grid = new Grid(20, 15, true); - private List _spawned = new List(); - private void Start() + private List _spawned = new (); + private async UniTask OnStart() { var pool = SharedPool.Of(); pool.Prefab = new AddressGameObjectPrefab { Source = K_CHARACTER02_KEY, Parent = transform, - PrepoolAmount = 100 + PrePoolAmount = 100 }; - pool.Prepool().Forget(); + await pool.Prepool(); } private async void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 50), "Spawn")) { + await OnStart(); for (int i = 0; i < 100; i++) { Spawn().Forget(); @@ -56,7 +57,7 @@ private async void OnGUI() private async UniTask Spawn() { - var pool = SharedPool.Of(); + var pool = SharedPool.Of(); var go = await pool.Rent(); go.transform.position = _grid.GetAvailableSlot().position; go.SetActive(true); @@ -65,7 +66,7 @@ private async UniTask Spawn() private void Return() { - var pool = SharedPool.Of(); + var pool = SharedPool.Of(); foreach (var go in _spawned) { pool.Return(go); @@ -75,7 +76,7 @@ private void Return() private async UniTask SpawnDisposableItems() { - var pool = SharedPool.Of(); + var pool = SharedPool.Of(); var context = pool.DisposableContext(); using var go = await context.Rent(); go.Instance.transform.position = _grid.GetAvailableSlot().position; @@ -86,7 +87,7 @@ private async UniTask SpawnDisposableItems() private void ReleaseAll() { - var pool = SharedPool.Of(); + var pool = SharedPool.Of(); pool.ReleaseInstances(0); _spawned.Clear(); } diff --git a/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample1.cs b/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample1.cs index 8ed1181..95d264b 100644 --- a/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample1.cs +++ b/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample1.cs @@ -1,8 +1,6 @@ -using System; using System.Threading; using Cysharp.Threading.Tasks; using UnityEngine; -using UnityEngine.Serialization; using ZBase.Collections.Pooled.Generic; using ZBase.Foundation.Pooling; @@ -25,30 +23,13 @@ public class AddressablePoolBehaviourSample1 : MonoBehaviour { [SerializeField] private AddressableColliderPoolBehaviour pool; - private readonly List _units = new List(); + private readonly List _units = new(); - private async void Start() - { - await this.pool.Prepool(gameObject.GetCancellationTokenOnDestroy()); - } - - private async void OnGUI() - { - if(GUI.Button(new Rect(0, 0, 150, 50), "Rent All")) - { - await Rent(gameObject.GetCancellationTokenOnDestroy()); - } - - if (GUI.Button(new Rect(0, 100, 150, 50), "Return All")) - { - this.pool.Return(this._units); - } - } + private async void Start() => await this.pool.Prepool(this.GetCancellationTokenOnDestroy()).SuppressCancellationThrow(); // ReSharper disable Unity.PerformanceAnalysis private async UniTask Rent(CancellationToken cancelToken = default) { - //fill units in range (-30,0,-15) to (30,0,15) sequentially, each unit is 1x1x1 for (int x = -20; x < 20; x++) { if(x % 2 == 0) @@ -64,5 +45,18 @@ private async UniTask Rent(CancellationToken cancelToken = default) } } } + + private async void OnGUI() + { + if(GUI.Button(new Rect(0, 0, 150, 50), "Rent All")) + { + await Rent(gameObject.GetCancellationTokenOnDestroy()); + } + + if (GUI.Button(new Rect(0, 100, 150, 50), "Return All")) + { + this.pool.Return(this._units); + } + } } } \ No newline at end of file diff --git a/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample2.cs b/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample2.cs index c94979a..03990d7 100644 --- a/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample2.cs +++ b/Assets/PoolSample/AddressablePools/Scripts/AddressablePoolBehaviourSample2.cs @@ -24,8 +24,8 @@ public class AddressablePoolBehaviourSample2 : MonoBehaviour { [SerializeField] private AssetRefGameObjectPoolBehaviour pool; - private List _spawned = new List(); - private List _slots = new List(); + private readonly List _spawned = new(); + private readonly List _slots = new(); private void Start() { @@ -45,12 +45,8 @@ private void Start() private async void OnGUI() { if(GUI.Button(new Rect(10, 10, 150, 50), "Spawn 100")) - { for (int i = 0; i < 100; i++) - { await Spawn(); - } - } if(GUI.Button(new Rect(10, 70, 150, 50), "Despawn 10")) { @@ -59,9 +55,7 @@ private async void OnGUI() } if(GUI.Button(new Rect(10, 130, 150, 50), "Release Keep 10")) - { Release(); - } } private async UniTask Spawn() @@ -74,23 +68,18 @@ private async UniTask Spawn() private void Despawn(ref int count) { - //despawn count last spawned active for (int i = this._spawned.Count - 1; i >= 0; i--) { - if(this._spawned[i].activeSelf) - { - this.pool.Return(this._spawned[i]); - count--; - if(count == 0) - break; - } + if (!this._spawned[i].activeSelf) + continue; + this.pool.Return(this._spawned[i]); + count--; + if(count == 0) + break; } } - - private void Release() - { - this.pool.ReleaseInstances(10); - } + + private void Release() => this.pool.ReleaseInstances(10); private void OnDestroy() { diff --git a/Assets/PoolSample/AddressablePools/Scripts/CustomAddressGameObjectPool.cs b/Assets/PoolSample/AddressablePools/Scripts/CustomAddressGameObjectPool.cs index 33fcfde..55033a6 100644 --- a/Assets/PoolSample/AddressablePools/Scripts/CustomAddressGameObjectPool.cs +++ b/Assets/PoolSample/AddressablePools/Scripts/CustomAddressGameObjectPool.cs @@ -8,35 +8,35 @@ namespace Pooling.Sample { public class CustomAddressGameObjectPool : AddressGameObjectPool { - private readonly UnityPrepooler _prepooler; + private readonly UnityPrePool _prePool; public CustomAddressGameObjectPool() : base() { - _prepooler = new UnityPrepooler(); + this._prePool = new UnityPrePool(); } public CustomAddressGameObjectPool(AddressGameObjectPrefab prefab) : base(prefab) { - _prepooler = new UnityPrepooler(); + this._prePool = new UnityPrePool(); } public CustomAddressGameObjectPool(UniqueQueue queue) : base(queue) { - _prepooler = new UnityPrepooler(); + this._prePool = new UnityPrePool(); } public CustomAddressGameObjectPool(UniqueQueue queue, AddressGameObjectPrefab prefab) : base(queue, prefab) { - _prepooler = new UnityPrepooler(); + this._prePool = new UnityPrePool(); } public async UniTask Prepool() { - await _prepooler.Prepool(Prefab, this, Prefab.Parent); + await this._prePool.PrePool(Prefab, this, Prefab.Parent); } } } \ No newline at end of file diff --git a/Assets/PoolSample/Demo.cs b/Assets/PoolSample/Demo.cs index c06a236..9d2f9ac 100644 --- a/Assets/PoolSample/Demo.cs +++ b/Assets/PoolSample/Demo.cs @@ -59,7 +59,7 @@ async void Start() Debug.Log(foo.Name); var gameObjectPrefab = new GameObjectPrefab() { - Parent = this.transform, PrepoolAmount = 40, Source = this.prefab + Parent = this.transform, PrePoolAmount = 40, Source = this.prefab }; _gameObjectPool = new GameObjectPool(gameObjectPrefab); diff --git a/Assets/PoolSample/GameObjectPools/GameObjectPool.unity b/Assets/PoolSample/GameObjectPools/GameObjectPool.unity index e3eb2f7..5497875 100644 --- a/Assets/PoolSample/GameObjectPools/GameObjectPool.unity +++ b/Assets/PoolSample/GameObjectPools/GameObjectPool.unity @@ -104,7 +104,7 @@ NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,7 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -146,13 +146,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 780156842} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1076946245} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1076946244 GameObject: @@ -178,6 +178,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1076946244} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -186,7 +187,6 @@ Transform: - {fileID: 1263221993} - {fileID: 780156843} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1076946246 MonoBehaviour: @@ -200,16 +200,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e9eaf35d17ab4b978cb9ce80e6d1355a, type: 3} m_Name: m_EditorClassIdentifier: - poolParent1: {fileID: 1263221993} - poolParent2: {fileID: 780156843} - prefab1: {fileID: 5535647646396653931, guid: 1dacc378b7a85e64696e56ce8d0ce8a7, type: 3} + prefab1: + _source: {fileID: 8597698371886135454, guid: 60ab07b23a75fbf458c80cba08df9edb, type: 3} + _parent: {fileID: 0} + _prePoolAmount: 0 prefab2: {fileID: 8597698371886135454, guid: 60ab07b23a75fbf458c80cba08df9edb, type: 3} - pool4: - _prefab: - _source: {fileID: 0} - _parent: {fileID: 0} - _prepoolAmount: 0 - _dontApplyPrefabParentOnReturn: 0 + sceneID: 0 + _spawnRadius: 20 + _spawnCount: 20 --- !u!1 &1252375770 GameObject: m_ObjectHideFlags: 0 @@ -270,13 +268,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1252375770} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1263221992 GameObject: @@ -301,19 +299,20 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1263221992} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1076946245} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1838171512 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 5685908662808553381, guid: bc0a642a3d8c4485fa3e2c739a4cf9c8, type: 3} @@ -365,4 +364,14 @@ PrefabInstance: value: Env objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: bc0a642a3d8c4485fa3e2c739a4cf9c8, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1076946245} + - {fileID: 1252375773} + - {fileID: 1838171512} diff --git a/Assets/PoolSample/GameObjectPools/Scripts/CustomGameObjectPool.cs b/Assets/PoolSample/GameObjectPools/Scripts/CustomGameObjectPool.cs index a2067ef..870c93d 100644 --- a/Assets/PoolSample/GameObjectPools/Scripts/CustomGameObjectPool.cs +++ b/Assets/PoolSample/GameObjectPools/Scripts/CustomGameObjectPool.cs @@ -1,6 +1,5 @@ -using System.Runtime.CompilerServices; +using Cysharp.Threading.Tasks; using UnityEngine; -using ZBase.Foundation.Pooling; using ZBase.Foundation.Pooling.UnityPools; namespace Pooling.Sample @@ -10,31 +9,8 @@ namespace Pooling.Sample /// public class CustomGameObjectPool : GameObjectPool { - private readonly UnityPrepooler _prepooler; - - public CustomGameObjectPool() : base() - { - _prepooler = new UnityPrepooler(); - } - - public CustomGameObjectPool(GameObjectPrefab prefab) : base(prefab) - { - _prepooler = new UnityPrepooler(); - } - - public CustomGameObjectPool(UniqueQueue queue) : base(queue) - { - _prepooler = new UnityPrepooler(); - } - - public CustomGameObjectPool(UniqueQueue queue, GameObjectPrefab prefab) : base(queue, prefab) - { - _prepooler = new UnityPrepooler(); - } + private readonly UnityPrePool _prePool = new(); - public void Prepool() - { - _prepooler.Prepool(Prefab, this, Prefab.Parent); - } + public void PrePool() => this._prePool.PrePool(Prefab, this, Prefab.Parent).Forget(); } } \ No newline at end of file diff --git a/Assets/PoolSample/GameObjectPools/Scripts/GameObjectPoolSample.cs b/Assets/PoolSample/GameObjectPools/Scripts/GameObjectPoolSample.cs index 307b0ea..eb5e73a 100644 --- a/Assets/PoolSample/GameObjectPools/Scripts/GameObjectPoolSample.cs +++ b/Assets/PoolSample/GameObjectPools/Scripts/GameObjectPoolSample.cs @@ -1,116 +1,61 @@ using Cysharp.Threading.Tasks; using UnityEngine; using ZBase.Collections.Pooled.Generic; -using ZBase.Foundation.Pooling; +using ZBase.Foundation.Pooling.GameObjectItem.LazyPool.Extensions; using ZBase.Foundation.Pooling.UnityPools; -using Grid = Sample.Environment.Grid; namespace Pooling.Sample { public class GameObjectPoolSample : MonoBehaviour { - public Transform poolParent1; - public Transform poolParent2; - public GameObject prefab1; + public GameObjectPrefab prefab1; public GameObject prefab2; - //you can access the spawned objects in your own list - public List myGameObjects = new List(); + public int sceneID; - //Manage lifetime of the pool yourself (in this case, the pool4 will not be registered in the SharedPool) - public GameObjectPool pool4; - public List pool4Objects = new List(); - - private Grid _grid = new Grid(20, 15, true); - private async UniTaskVoid Start() + private async UniTask Spawn() + { + var item = await LazyGameObjectPool.Rent(prefab1); + item.SetActive(true); + var pos = Random.insideUnitCircle * _spawnRadius; + item.transform.position = new Vector3 {x = pos.x, y = 0, z = pos.y}; + _spawned.Add(item); + } + + private async UniTask SpawnByPrefab() { - /* - //GameObjectPool do not have implementation of Prepool - var pool1 = new GameObjectPool(); - pool1.Prefab = new GameObjectPrefab() {Parent = poolParent1, Source = this.prefab1}; - var item = await pool1.Rent(); - item.transform.position = this._grid.GetAvailableSlot().position; - */ + var item = await LazyGameObjectPool.Rent(prefab2); + item.SetActive(true); + var pos = Random.insideUnitCircle * _spawnRadius; + item.transform.position = new Vector3 {x = pos.x, y = 0, z = pos.y}; + _spawned.Add(item); + } - /* - //Create a new CustomGameObjectPool and prepool 10 objects - //This pool is not registered in the SharedPool, so you can't get it later using SharedPool.Of() - var pool = new CustomGameObjectPool(); - pool.Prefab = new GameObjectPrefab() {Parent = poolParent1, PrepoolAmount = 10, Source = this.prefab2}; - pool.Prepool(); - */ - //Create a new CustomGameObjectPool and prepool 10 objects - //This pool will be automatically registered in the SharedPool, so you can globally get it later using SharedPool.Of() - var pool2 = SharedPool.Of(); - pool2.Prefab = new GameObjectPrefab() {Parent = poolParent1, PrepoolAmount = 10, Source = this.prefab1}; - pool2.Prepool(); - - pool4 = new GameObjectPool(new GameObjectPrefab(){Parent = poolParent2, PrepoolAmount = 100, Source = this.prefab2}); - } - private async void OnGUI() + private void OnGUI() { //manually get the CustomGameObjectPool then rent and spawn some objects - if (GUI.Button(new Rect(0, 0, 300, 50), "Spawn in Shared Pool")) - { - var pool = SharedPool.Of(); - for (int i = 0; i < 50; i++) - { - var go = await pool.Rent(); - go.transform.position = this._grid.GetAvailableSlot().position; - go.SetActive(true); - this.myGameObjects.Add(go); - } - } - - //manually get the CustomGameObjectPool then return and despawn some objects - if (GUI.Button(new Rect(0, 100, 300, 50), "Despawn in SharedPool")) - { - var pool = SharedPool.Of(); - //despawn first 7 objects - for (int i = 0; i < 50; i++) - { - var go = this.myGameObjects[i]; - pool.Return(go); - this._grid.FreeSlot(go.transform.position); - } - - /* - you can despawn all the list: pool.Return(this.myGameObjects); - */ - } - - if (GUI.Button(new Rect(0, 200, 150, 50), "Spawn in Pool 4")) + if (GUI.Button(new Rect(0, 0, 150, 50), "Spawn")) + for (int i = 0; i < _spawnCount; i++) + Spawn().Forget(); + if (GUI.Button(new Rect(0, 60, 150, 50), "Spawn By Prefab")) + for (int i = 0; i < this._spawnCount; i++) + SpawnByPrefab().Forget(); + if (GUI.Button(new Rect(0, 120, 150, 50), "DeSpawn All")) { - for (int i = 0; i < 100; i++) + foreach (var go in _spawned) { - var go = await this.pool4.Rent(); - go.transform.position = this._grid.GetAvailableSlot().position; - go.SetActive(true); - this.pool4Objects.Add(go); + go.SetActive(false); + LazyGameObjectPool.Return(go); } - Debug.Log("Rent 100 game objects in Pool 4"); - Debug.Log("There is " + this.pool4.Count() + " objects in Pool 4"); + _spawned.Clear(); } - - if (GUI.Button(new Rect(0, 300, 150, 50), "Despawn in Pool 4")) - { - //return random 50 times in pool4, may some objects will be returned multiple times - for (int i = 0; i < 50; i++) - { - var go = this.pool4Objects[UnityEngine.Random.Range(0, this.pool4Objects.Count)]; - this.pool4.Return(go); - this._grid.FreeSlot(go.transform.position); - } - Debug.Log("Return random 50 times game objects in Pool 4"); - Debug.Log("There is " + this.pool4.Count() + " objects in Pool 4"); - } - - } - - private void OnDestroy() - { - //manually dispose the pool4 - this.pool4.Dispose(); + if (!GUI.Button(new Rect(0, 180, 150, 50), "Switch Scene")) + return; + UnityEngine.SceneManagement.SceneManager.LoadScene(sceneID); } + + [SerializeField] private float _spawnRadius = 20f; + [SerializeField] private int _spawnCount = 20; + private readonly List _spawned = new(); } } \ No newline at end of file diff --git a/Assets/PoolSample/Pooling.Sample.asmdef b/Assets/PoolSample/Pooling.Sample.asmdef index c1c120b..3c5cd14 100644 --- a/Assets/PoolSample/Pooling.Sample.asmdef +++ b/Assets/PoolSample/Pooling.Sample.asmdef @@ -11,7 +11,8 @@ "ZBase.Collections.Pooled", "ZBase.Foundation.Pooling", "ZBase.Foundation.Pooling.Addressables", - "Sample.Environment" + "Sample.Environment", + "ItemPooling" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/PoolSample/ScriptablePools/Prefabs/Character_P01.prefab b/Assets/PoolSample/ScriptablePools/Prefabs/Character_P01.prefab index 1659a7e..dac7c12 100644 --- a/Assets/PoolSample/ScriptablePools/Prefabs/Character_P01.prefab +++ b/Assets/PoolSample/ScriptablePools/Prefabs/Character_P01.prefab @@ -23,6 +23,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 87579466245271997} + serializedVersion: 2 m_LocalRotation: {x: 0.019879602, y: -0.40998435, z: 0.044163775, w: 0.9108058} m_LocalPosition: {x: -0.016145382, y: 0.0049800063, z: -0.20797296} m_LocalScale: {x: 1, y: 1, z: 1} @@ -30,7 +31,6 @@ Transform: m_Children: - {fileID: 738286535971428345} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &102343006776975947 GameObject: @@ -55,13 +55,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 102343006776975947} + serializedVersion: 2 m_LocalRotation: {x: -0.018653171, y: -0.018653171, z: 0.7068607, w: 0.7068607} m_LocalPosition: {x: 0.018659662, y: -0.08321956, z: 0.0010733596} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8439100899513847687} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &456737110537875549 GameObject: @@ -86,6 +86,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 456737110537875549} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.09853762, w: 0.99513334} m_LocalPosition: {x: -0.30899003, y: 7.105427e-17, z: -7.424184e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -93,7 +94,6 @@ Transform: m_Children: - {fileID: 5482323410964126251} m_Father: {fileID: 7063890055000896029} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &594747381485460964 GameObject: @@ -118,13 +118,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 594747381485460964} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.28746313, z: -0, w: 0.95779175} m_LocalPosition: {x: 0.35611197, y: 3.100587e-17, z: -0.0000042392044} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7748826485428433219} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &654931664071918654 GameObject: @@ -149,13 +149,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 654931664071918654} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.24131815, y: -0.13323142, z: 0.0005894331} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7312941058919804357} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &665214393656486505 GameObject: @@ -180,13 +180,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 665214393656486505} + serializedVersion: 2 m_LocalRotation: {x: -0.015762473, y: -0.7069311, z: -0.015762473, w: 0.7069311} m_LocalPosition: {x: 0.004094967, y: -0.27914742, z: -2.8367557e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5926225148148664443} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &869429754410150383 GameObject: @@ -211,6 +211,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 869429754410150383} + serializedVersion: 2 m_LocalRotation: {x: 0.40998435, y: 0.019879602, z: 0.9108058, w: -0.044163775} m_LocalPosition: {x: -0.016146528, y: 0.0049800063, z: 0.207973} m_LocalScale: {x: 1, y: 1, z: 1} @@ -218,7 +219,6 @@ Transform: m_Children: - {fileID: 6108869574807812755} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &974885687907763771 GameObject: @@ -243,6 +243,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 974885687907763771} + serializedVersion: 2 m_LocalRotation: {x: -0.019574154, y: -0.01433758, z: -0.016081778, w: 0.9995763} m_LocalPosition: {x: -0.15340334, y: -0.017944258, z: 0.001143231} m_LocalScale: {x: 1, y: 1, z: 1} @@ -250,7 +251,6 @@ Transform: m_Children: - {fileID: 4124910992819119536} m_Father: {fileID: 8758932156336025228} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &977776698513753027 GameObject: @@ -276,13 +276,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 977776698513753027} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 420031629014426136} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &1204754186042796329 SkinnedMeshRenderer: @@ -415,6 +415,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1186187869344917365} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.006312754, w: 0.9999801} m_LocalPosition: {x: -0.18918252, y: 0.0049800063, z: 1.1443254e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -422,7 +423,6 @@ Transform: m_Children: - {fileID: 7805203505397084566} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1266566330199539671 GameObject: @@ -447,13 +447,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1266566330199539671} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.110078454, y: 0.009448838, z: -0.0006042899} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1496863322693239511} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1346701583620917993 GameObject: @@ -478,6 +478,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1346701583620917993} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0.76580924, w: 0.6430679} m_LocalPosition: {x: 0.11468992, y: -0.11381889, z: -1.1558126e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -485,7 +486,6 @@ Transform: m_Children: - {fileID: 4699360250324849514} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1656939751193480654 GameObject: @@ -510,6 +510,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1656939751193480654} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -517,7 +518,6 @@ Transform: m_Children: - {fileID: 1691922366214638172} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1712899803133419893 GameObject: @@ -542,6 +542,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1712899803133419893} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -549,7 +550,6 @@ Transform: m_Children: - {fileID: 3331756410027397337} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1720846097131416287 GameObject: @@ -574,6 +574,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1720846097131416287} + serializedVersion: 2 m_LocalRotation: {x: -2.7535306e-17, y: -3.897205e-18, z: 0.20162798, w: 0.9794622} m_LocalPosition: {x: -0.20905116, y: 1.7763567e-16, z: 1.0606601e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -581,7 +582,6 @@ Transform: m_Children: - {fileID: 6078527746324431682} m_Father: {fileID: 1283397127760695502} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2038662461075362326 GameObject: @@ -606,13 +606,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2038662461075362326} + serializedVersion: 2 m_LocalRotation: {x: 0.004463791, y: -0.7070927, z: 0.004463791, w: 0.7070927} m_LocalPosition: {x: -0.6819025, y: -0.00860988, z: 7.8409694e-17} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4069142763321466411} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2188219209632303248 GameObject: @@ -637,13 +637,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2188219209632303248} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.13957906, y: 0.0022421728, z: -0.00047287406} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1496863322693239511} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2261553530829999746 GameObject: @@ -668,13 +668,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2261553530829999746} + serializedVersion: 2 m_LocalRotation: {x: 2.3129124e-18, y: -0.7257409, z: -2.3129124e-18, w: 0.6879682} m_LocalPosition: {x: 0.29144114, y: 0.00000043365793, z: -0.00000014326524} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6108869574807812755} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2435569958190950769 GameObject: @@ -699,13 +699,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2435569958190950769} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.5431475, z: -0, w: 0.8396373} m_LocalPosition: {x: 0.67569244, y: 0.000000046456332, z: 0.000001032785} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2385499082292159241} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2460713244427948585 GameObject: @@ -731,13 +731,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2460713244427948585} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2982616874506314659} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &1378507907859086628 SkinnedMeshRenderer: @@ -870,6 +870,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2678926418829430635} + serializedVersion: 2 m_LocalRotation: {x: 0.03173624, y: -0.72198325, z: 0.15612186, w: 0.67331934} m_LocalPosition: {x: -0.063511945, y: 0.030065516, z: -0.20842351} m_LocalScale: {x: 1, y: 1, z: 1} @@ -877,7 +878,6 @@ Transform: m_Children: - {fileID: 7845754180672164733} m_Father: {fileID: 1283397127760695502} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2912347542243836269 GameObject: @@ -902,6 +902,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2912347542243836269} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -909,7 +910,6 @@ Transform: m_Children: - {fileID: 9075802281208305134} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3024200014160179977 GameObject: @@ -934,6 +934,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3024200014160179977} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.47399396, z: -0, w: 0.88052815} m_LocalPosition: {x: 0.06945152, y: 0.0049800063, z: -0.2359865} m_LocalScale: {x: 1, y: 1, z: 1} @@ -941,7 +942,6 @@ Transform: m_Children: - {fileID: 3579897352336261993} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3174823477700166916 GameObject: @@ -966,6 +966,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3174823477700166916} + serializedVersion: 2 m_LocalRotation: {x: 6.142407e-17, y: 1.655707e-16, z: -0.0765332, w: 0.99706703} m_LocalPosition: {x: -0.15357347, y: -3.6637358e-17, z: 4.178964e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -973,7 +974,6 @@ Transform: m_Children: - {fileID: 1283397127760695502} m_Father: {fileID: 5926225148148664443} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3196245902660274484 GameObject: @@ -998,6 +998,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3196245902660274484} + serializedVersion: 2 m_LocalRotation: {x: 0.0015542243, y: 0.022218248, z: -0.11379966, w: 0.993254} m_LocalPosition: {x: 0.15415917, y: 0.00000004352324, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1005,7 +1006,6 @@ Transform: m_Children: - {fileID: 2270210955174571702} m_Father: {fileID: 1478266937938357226} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3588981539407820647 GameObject: @@ -1031,13 +1031,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3588981539407820647} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1364586009460595468} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &5719686150480389549 SkinnedMeshRenderer: @@ -1170,6 +1170,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3589868412656243569} + serializedVersion: 2 m_LocalRotation: {x: 0.0015542243, y: 0.022218248, z: -0.11379966, w: 0.993254} m_LocalPosition: {x: -0.1541595, y: -2.664535e-16, z: -2.131628e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1177,7 +1178,6 @@ Transform: m_Children: - {fileID: 5789217477003333498} m_Father: {fileID: 4734430458834019668} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3706036688498988024 GameObject: @@ -1202,13 +1202,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3706036688498988024} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.13957767, y: -0.0022430373, z: 0.00047288262} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7312941058919804357} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3817569925875762477 GameObject: @@ -1233,6 +1233,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3817569925875762477} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1240,7 +1241,6 @@ Transform: m_Children: - {fileID: 3853974761597031529} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3853164971416451268 GameObject: @@ -1266,13 +1266,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3853164971416451268} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4824034921282773783} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &8339928928853977412 SkinnedMeshRenderer: @@ -1405,13 +1405,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4230536342340116334} + serializedVersion: 2 m_LocalRotation: {x: 0.5415089, y: 0.45471767, z: 0.5415089, w: -0.45471767} m_LocalPosition: {x: -0.1039998, y: -0.006094659, z: -1.09662166e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2413403082384274742} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4239961458664028688 GameObject: @@ -1436,6 +1436,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4239961458664028688} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1443,7 +1444,6 @@ Transform: m_Children: - {fileID: 2794809067659323152} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4305880457951329678 GameObject: @@ -1468,6 +1468,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4305880457951329678} + serializedVersion: 2 m_LocalRotation: {x: -0.7056592, y: 0.014749782, z: -0.0129053835, w: 0.7082804} m_LocalPosition: {x: -0.40930396, y: -2.842171e-16, z: 2.2737367e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1478,7 +1479,6 @@ Transform: - {fileID: 784691246771375766} - {fileID: 7811792676116116283} m_Father: {fileID: 5789217477003333498} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4339519752159341881 GameObject: @@ -1503,6 +1503,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4339519752159341881} + serializedVersion: 2 m_LocalRotation: {x: -0.7056592, y: 0.014749782, z: -0.0129053835, w: 0.7082804} m_LocalPosition: {x: 0.40930742, y: 4.440892e-18, z: -7.1054274e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1513,7 +1514,6 @@ Transform: - {fileID: 3287541827770039414} - {fileID: 6742949812747898546} m_Father: {fileID: 2270210955174571702} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4404557115531491881 GameObject: @@ -1538,6 +1538,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4404557115531491881} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1545,7 +1546,6 @@ Transform: m_Children: - {fileID: 7122078940071272362} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4414844631148323421 GameObject: @@ -1570,6 +1570,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4414844631148323421} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1577,7 +1578,6 @@ Transform: m_Children: - {fileID: 9183302009042485644} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4423779623539917123 GameObject: @@ -1602,6 +1602,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4423779623539917123} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.43467525, z: -0, w: 0.9005873} m_LocalPosition: {x: 0.21829534, y: -0.0000002822668, z: -0.0000019725908} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1609,7 +1610,6 @@ Transform: m_Children: - {fileID: 1462874664368663027} m_Father: {fileID: 9027430480726930718} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4504394502470117823 GameObject: @@ -1635,13 +1635,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4504394502470117823} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2769241637506005437} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &7959036452802090198 SkinnedMeshRenderer: @@ -1774,13 +1774,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4701406902020134600} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0.7071068, z: 0, w: 0.7071068} m_LocalPosition: {x: 0.16025886, y: 0.020835321, z: 1.5729948e-18} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6078527746324431682} - m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4991540948030905780 GameObject: @@ -1805,6 +1805,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4991540948030905780} + serializedVersion: 2 m_LocalRotation: {x: -0.3024084, y: 0.95317847, z: 6.7676127e-16, w: -2.7212164e-16} m_LocalPosition: {x: -0.030352466, y: 0.25417748, z: 2.7145378e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1812,7 +1813,6 @@ Transform: m_Children: - {fileID: 7063890055000896029} m_Father: {fileID: 6176328368197471825} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5127639685006055291 GameObject: @@ -1837,6 +1837,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5127639685006055291} + serializedVersion: 2 m_LocalRotation: {x: -0.05363183, y: 0.00061813387, z: 0.022184182, w: 0.99831414} m_LocalPosition: {x: -0.25370672, y: 0.010923714, z: -0.0016354381} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1844,7 +1845,6 @@ Transform: m_Children: - {fileID: 898231667641610401} m_Father: {fileID: 8111828103614620543} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5143250635345817522 GameObject: @@ -1856,6 +1856,7 @@ GameObject: m_Component: - component: {fileID: 5488673670398653704} - component: {fileID: 5449662185156111757} + - component: {fileID: -8585594812908407642} m_Layer: 0 m_Name: Character_P01 m_TagString: Untagged @@ -1870,6 +1871,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5143250635345817522} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} @@ -1884,7 +1886,6 @@ Transform: - {fileID: 8517333686487891612} - {fileID: 887737656511170105} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &5449662185156111757 Animator: @@ -1906,6 +1907,20 @@ Animator: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!114 &-8585594812908407642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5143250635345817522} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ccfd0da2bab4198bf7a2413d826a967, type: 3} + m_Name: + m_EditorClassIdentifier: + _lifeTime: 2 --- !u!1 &5229539704271912871 GameObject: m_ObjectHideFlags: 0 @@ -1929,6 +1944,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5229539704271912871} + serializedVersion: 2 m_LocalRotation: {x: -0.019583104, y: -0.014337628, z: -0.016081654, w: 0.9995761} m_LocalPosition: {x: 0.15340362, y: 0.01794422, z: -0.0011433699} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1936,7 +1952,6 @@ Transform: m_Children: - {fileID: 5376040885117629261} m_Father: {fileID: 3366088592808131587} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5613644357447253261 GameObject: @@ -1962,13 +1977,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5613644357447253261} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 887737656511170105} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &8915844096056353246 SkinnedMeshRenderer: @@ -2101,6 +2116,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5636728604099005232} + serializedVersion: 2 m_LocalRotation: {x: 0.47399396, y: 5.5526276e-16, z: 0.88052815, w: -1.0314995e-15} m_LocalPosition: {x: 0.06945347, y: 0.0049800063, z: 0.235986} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2108,7 +2124,6 @@ Transform: m_Children: - {fileID: 3730613643346740201} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5645592642720882991 GameObject: @@ -2133,6 +2148,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5645592642720882991} + serializedVersion: 2 m_LocalRotation: {x: 0.72198325, y: 0.03173624, z: 0.67331934, w: -0.15612186} m_LocalPosition: {x: -0.06351176, y: 0.030065548, z: 0.20842399} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2140,7 +2156,6 @@ Transform: m_Children: - {fileID: 1986708226969140497} m_Father: {fileID: 1283397127760695502} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5990483450429035875 GameObject: @@ -2165,6 +2180,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5990483450429035875} + serializedVersion: 2 m_LocalRotation: {x: 1.485756e-30, y: 5.747986e-29, z: 0.03987671, w: 0.99920464} m_LocalPosition: {x: -0.35891947, y: -6.661338e-18, z: -4.2632563e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2172,7 +2188,6 @@ Transform: m_Children: - {fileID: 7312941058919804357} m_Father: {fileID: 7845754180672164733} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6410501128257649700 GameObject: @@ -2197,6 +2212,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6410501128257649700} + serializedVersion: 2 m_LocalRotation: {x: -0.0013932837, y: -0.20964532, z: 0.0064980704, w: 0.97775495} m_LocalPosition: {x: -0.120417975, y: 0.0049800063, z: -0.081912056} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2204,7 +2220,6 @@ Transform: m_Children: - {fileID: 9202394604179414725} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6481733797294446438 GameObject: @@ -2229,13 +2244,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6481733797294446438} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.5431475, z: -0, w: 0.8396373} m_LocalPosition: {x: -0.67569554, y: -2.8865798e-17, z: -5.684342e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2362148052469027435} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6570347010630812377 GameObject: @@ -2260,6 +2275,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6570347010630812377} + serializedVersion: 2 m_LocalRotation: {x: 0.07721848, y: 0.0319301, z: -0.13278173, w: 0.9876167} m_LocalPosition: {x: 0.022657402, y: -0.0018067064, z: -0.17085041} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2267,7 +2283,6 @@ Transform: m_Children: - {fileID: 3366088592808131587} m_Father: {fileID: 6176328368197471825} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6815822208755467100 GameObject: @@ -2292,6 +2307,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6815822208755467100} + serializedVersion: 2 m_LocalRotation: {x: -0.031930987, y: 0.077209614, z: 0.98761743, w: 0.13278146} m_LocalPosition: {x: 0.022657752, y: -0.0018067972, z: 0.17085} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2299,7 +2315,6 @@ Transform: m_Children: - {fileID: 8758932156336025228} m_Father: {fileID: 6176328368197471825} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6880913526979753240 GameObject: @@ -2324,13 +2339,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6880913526979753240} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.11008295, y: -0.009449474, z: 0.0006042766} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7312941058919804357} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6948908413824387969 GameObject: @@ -2355,13 +2370,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6948908413824387969} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0.28746313, z: -0, w: 0.95779175} m_LocalPosition: {x: -0.35610884, y: 2.8398991e-31, z: -1.4210854e-16} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2959356354339617322} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7302799138544732844 GameObject: @@ -2386,13 +2401,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7302799138544732844} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.06756819, w: 0.99771464} m_LocalPosition: {x: -0.30677703, y: 0.011362112, z: -3.952184e-17} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2229985312042118916} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7391259593930885260 GameObject: @@ -2417,6 +2432,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7391259593930885260} + serializedVersion: 2 m_LocalRotation: {x: 0.08801344, y: 0.7016079, z: 0.08801344, w: 0.7016079} m_LocalPosition: {x: -3.0999767e-32, y: -0.0007635658, z: 0.46243998} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2427,7 +2443,6 @@ Transform: - {fileID: 7193043019390489242} - {fileID: 8111828103614620543} m_Father: {fileID: 8517333686487891612} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7546765193722654569 GameObject: @@ -2452,6 +2467,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7546765193722654569} + serializedVersion: 2 m_LocalRotation: {x: -1.3548951e-16, y: 4.5886806e-17, z: -0.08148055, w: 0.99667495} m_LocalPosition: {x: -0.14891407, y: 1.2434498e-16, z: 4.8846454e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2461,7 +2477,6 @@ Transform: - {fileID: 1478266937938357226} - {fileID: 8621612622155584086} m_Father: {fileID: 6587067380640101537} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7627700492663890896 GameObject: @@ -2486,6 +2501,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7627700492663890896} + serializedVersion: 2 m_LocalRotation: {x: 1.00992795e-29, y: 2.648741e-28, z: 0.03987671, w: 0.99920464} m_LocalPosition: {x: 0.35891908, y: 1.5543122e-17, z: 1.4210854e-16} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2493,7 +2509,6 @@ Transform: m_Children: - {fileID: 1496863322693239511} m_Father: {fileID: 1986708226969140497} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7696031279786655801 GameObject: @@ -2518,6 +2533,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7696031279786655801} + serializedVersion: 2 m_LocalRotation: {x: -0.05363183, y: 0.00061813387, z: 0.022184182, w: 0.99831414} m_LocalPosition: {x: 0.25370672, y: -0.010923628, z: 0.0016361566} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2525,7 +2541,6 @@ Transform: m_Children: - {fileID: 8439100899513847687} m_Father: {fileID: 7193043019390489242} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7713339776856982282 GameObject: @@ -2550,13 +2565,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7713339776856982282} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: -0.27837098, y: 0.14700453, z: -0.00056984223} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7312941058919804357} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8272640787805210172 GameObject: @@ -2581,13 +2596,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8272640787805210172} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.27836862, y: -0.14700456, z: 0.0005698343} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1496863322693239511} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8296525948743463448 GameObject: @@ -2612,6 +2627,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8296525948743463448} + serializedVersion: 2 m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2619,7 +2635,6 @@ Transform: m_Children: - {fileID: 6176328368197471825} m_Father: {fileID: 5488673670398653704} - m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8326762379355067600 GameObject: @@ -2644,13 +2659,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8326762379355067600} + serializedVersion: 2 m_LocalRotation: {x: 0.70580983, y: -0.0022091598, z: 0.0003184791, w: 0.7083978} m_LocalPosition: {x: 0.24130988, y: 0.13323241, z: -0.0005894659} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1496863322693239511} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8482346146269408321 GameObject: @@ -2675,6 +2690,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8482346146269408321} + serializedVersion: 2 m_LocalRotation: {x: 2.2397977e-18, y: 5.568265e-17, z: -0.10232073, w: 0.99475145} m_LocalPosition: {x: -0.14028804, y: 0.0061973166, z: 2.2516412e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2683,7 +2699,6 @@ Transform: - {fileID: 1058474480227476786} - {fileID: 6587067380640101537} m_Father: {fileID: 6176328368197471825} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8496647645266993343 GameObject: @@ -2708,13 +2723,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8496647645266993343} + serializedVersion: 2 m_LocalRotation: {x: -0.018653171, y: -0.018653171, z: 0.7068607, w: 0.7068607} m_LocalPosition: {x: -0.018659646, y: 0.0832196, z: -0.0010736184} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 898231667641610401} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8626634349840445357 GameObject: @@ -2739,6 +2754,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8626634349840445357} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.43467525, z: -0, w: 0.9005873} m_LocalPosition: {x: -0.21829395, y: -7.105427e-17, z: 1.4210854e-15} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2746,7 +2762,6 @@ Transform: m_Children: - {fileID: 2144034615767353994} m_Father: {fileID: 2241838139369937818} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8793651686068708314 GameObject: @@ -2771,6 +2786,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8793651686068708314} + serializedVersion: 2 m_LocalRotation: {x: 0.20964532, y: -0.0013932837, z: 0.97775495, w: -0.0064980704} m_LocalPosition: {x: -0.12041652, y: 0.0049800063, z: 0.08191209} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2778,7 +2794,6 @@ Transform: m_Children: - {fileID: 2482574556682163242} m_Father: {fileID: 6078527746324431682} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8835251813235354970 GameObject: @@ -2803,6 +2818,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8835251813235354970} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.0670836, w: 0.99774736} m_LocalPosition: {x: -0.30618182, y: -6.0396133e-16, z: 8.413475e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -2818,7 +2834,6 @@ Transform: - {fileID: 7748826485428433219} - {fileID: 3969208101077916263} m_Father: {fileID: 8621612622155584086} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9056742210991128922 GameObject: @@ -2844,13 +2859,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9056742210991128922} + serializedVersion: 2 m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7847468916615446689} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!137 &7374491305410030911 SkinnedMeshRenderer: @@ -2983,13 +2998,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9185300519223470522} + serializedVersion: 2 m_LocalRotation: {x: 2.3129124e-18, y: -0.7257409, z: -2.3129124e-18, w: 0.6879682} m_LocalPosition: {x: -0.2914453, y: 8.946976e-13, z: -2.131628e-15} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 738286535971428345} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9197826329153354311 GameObject: @@ -3014,6 +3029,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9197826329153354311} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: -0.09367575, w: 0.9956028} m_LocalPosition: {x: -0.28033707, y: 4.973799e-16, z: -9.895423e-17} m_LocalScale: {x: 1, y: 1, z: 1} @@ -3021,5 +3037,4 @@ Transform: m_Children: - {fileID: 2229985312042118916} m_Father: {fileID: 6635785579605554384} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Render/Universal Render Pipeline Asset.asset b/Assets/Render/Universal Render Pipeline Asset.asset index 82c4377..2c58e9b 100644 --- a/Assets/Render/Universal Render Pipeline Asset.asset +++ b/Assets/Render/Universal Render Pipeline Asset.asset @@ -12,8 +12,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} m_Name: Universal Render Pipeline Asset m_EditorClassIdentifier: - k_AssetVersion: 9 - k_AssetPreviousVersion: 9 + k_AssetVersion: 11 + k_AssetPreviousVersion: 11 m_RendererType: 1 m_RendererData: {fileID: 0} m_RendererDataList: @@ -23,13 +23,16 @@ MonoBehaviour: m_RequireOpaqueTexture: 0 m_OpaqueDownsampling: 1 m_SupportsTerrainHoles: 1 - m_StoreActionsOptimization: 0 m_SupportsHDR: 1 + m_HDRColorBufferPrecision: 0 m_MSAA: 8 m_RenderScale: 1 m_UpscalingFilter: 0 m_FsrOverrideSharpness: 0 m_FsrSharpness: 0.92 + m_EnableLODCrossFade: 1 + m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 m_MainLightRenderingMode: 1 m_MainLightShadowsSupported: 1 m_MainLightShadowmapResolution: 2048 @@ -54,22 +57,54 @@ MonoBehaviour: m_SoftShadowsSupported: 0 m_ConservativeEnclosingSphere: 1 m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 2 m_AdditionalLightsCookieResolution: 2048 m_AdditionalLightsCookieFormat: 3 m_UseSRPBatcher: 1 m_SupportsDynamicBatching: 0 m_MixedLightingSupported: 1 + m_SupportsLightCookies: 1 m_SupportsLightLayers: 0 m_DebugLevel: 0 + m_StoreActionsOptimization: 0 + m_EnableRenderGraph: 0 m_UseAdaptivePerformance: 1 m_ColorGradingMode: 0 m_ColorGradingLutSize: 32 m_UseFastSRGBLinearConversion: 0 + m_SupportDataDrivenLensFlare: 1 m_ShadowType: 1 m_LocalShadowsSupported: 0 m_LocalShadowsAtlasResolution: 256 m_MaxPixelLights: 0 m_ShadowAtlasResolution: 256 - m_ShaderVariantLogLevel: 0 m_VolumeFrameworkUpdateMode: 0 + m_Textures: + blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} + m_PrefilteringModeMainLightShadows: 1 + m_PrefilteringModeAdditionalLight: 4 + m_PrefilteringModeAdditionalLightShadows: 1 + m_PrefilterXRKeywords: 0 + m_PrefilteringModeForwardPlus: 1 + m_PrefilteringModeDeferredRendering: 1 + m_PrefilteringModeScreenSpaceOcclusion: 1 + m_PrefilterDebugKeywords: 0 + m_PrefilterWriteRenderingLayers: 0 + m_PrefilterHDROutput: 0 + m_PrefilterSSAODepthNormals: 0 + m_PrefilterSSAOSourceDepthLow: 0 + m_PrefilterSSAOSourceDepthMedium: 0 + m_PrefilterSSAOSourceDepthHigh: 0 + m_PrefilterSSAOInterleaved: 0 + m_PrefilterSSAOBlueNoise: 0 + m_PrefilterSSAOSampleCountLow: 0 + m_PrefilterSSAOSampleCountMedium: 0 + m_PrefilterSSAOSampleCountHigh: 0 + m_PrefilterDBufferMRT1: 0 + m_PrefilterDBufferMRT2: 0 + m_PrefilterDBufferMRT3: 0 + m_PrefilterScreenCoord: 0 + m_PrefilterNativeRenderPass: 0 + m_ShaderVariantLogLevel: 0 m_ShadowCascades: 0 diff --git a/Assets/Render/Universal Render Pipeline Asset_Renderer.asset b/Assets/Render/Universal Render Pipeline Asset_Renderer.asset index 1a4c991..171745c 100644 --- a/Assets/Render/Universal Render Pipeline Asset_Renderer.asset +++ b/Assets/Render/Universal Render Pipeline Asset_Renderer.asset @@ -17,7 +17,7 @@ MonoBehaviour: m_RendererFeatures: [] m_RendererFeatureMap: m_UseNativeRenderPass: 0 - postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + postProcessData: {fileID: 0} xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2} shaders: blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} diff --git a/Assets/Render/Universal Renderer Data.asset b/Assets/Render/Universal Renderer Data.asset index f9cd158..cc34004 100644 --- a/Assets/Render/Universal Renderer Data.asset +++ b/Assets/Render/Universal Renderer Data.asset @@ -17,7 +17,7 @@ MonoBehaviour: m_RendererFeatures: [] m_RendererFeatureMap: m_UseNativeRenderPass: 0 - postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + postProcessData: {fileID: 0} xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2} shaders: blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} diff --git a/Assets/Render/UniversalRenderPipelineGlobalSettings.asset b/Assets/Render/UniversalRenderPipelineGlobalSettings.asset index a996a2e..35619de 100644 --- a/Assets/Render/UniversalRenderPipelineGlobalSettings.asset +++ b/Assets/Render/UniversalRenderPipelineGlobalSettings.asset @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3} m_Name: UniversalRenderPipelineGlobalSettings m_EditorClassIdentifier: - k_AssetVersion: 2 + k_AssetVersion: 3 lightLayerName0: Light Layer default lightLayerName1: Light Layer 1 lightLayerName2: Light Layer 2 diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool.meta new file mode 100644 index 0000000..887d59b --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3e5d04ffff9a43d3a45bc183454a025c +timeCreated: 1706689866 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation.meta new file mode 100644 index 0000000..f612fdb --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a6fcca5fb5444205b3a29ef26b1f5368 +timeCreated: 1706691037 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools.meta new file mode 100644 index 0000000..375468b --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3de7c7c0d5d64b5e9d10192e688ffc02 +timeCreated: 1706691056 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/AssetRefGameObjectItemPool.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/AssetRefGameObjectItemPool.cs new file mode 100644 index 0000000..19b9e51 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/AssetRefGameObjectItemPool.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using ZBase.Foundation.Pooling.AddressableAssets; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class AssetRefGameObjectItemPool : AssetRefGameObjectPool + { + public AssetRefGameObjectItemPool(AssetRefGameObjectPrefab prefab) : base(prefab) + { + } + + protected override void ProcessNewInstance(GameObject instance) + { + base.ProcessNewInstance(instance); + if (!instance.TryGetComponent(out var poolItem)) + poolItem = instance.AddComponent(); + poolItem.SetUp(this); + } + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/AssetRefGameObjectItemPool.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/AssetRefGameObjectItemPool.cs.meta new file mode 100644 index 0000000..19a554b --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/AssetRefGameObjectItemPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d551af5f51a2477d98e29c8d09eb95d8 +timeCreated: 1706691066 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/GameObjectItemPool.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/GameObjectItemPool.cs new file mode 100644 index 0000000..f3be035 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/GameObjectItemPool.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using ZBase.Foundation.Pooling.UnityPools; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public sealed class GameObjectItemPool : GameObjectPool + { + internal event Action OnPoolEmpty; + private readonly List _poolItems = new(); + + internal int ID { get; } + + public GameObjectItemPool(GameObjectPrefab prefab) : base(prefab) => ID = Prefab.Source.GetInstanceID(); + + protected override void ProcessNewInstance(GameObject instance) + { + base.ProcessNewInstance(instance); + if (!instance.TryGetComponent(out var poolItem)) + poolItem = instance.AddComponent(); + poolItem.SetUp(this); + poolItem.OnItemDestroy += OnItemDestroy; + this._poolItems.Add(instance.GetInstanceID()); + } + + private void OnItemDestroy(GameObject instance) + { + this._poolItems.Remove(instance.GetInstanceID()); + if(this._poolItems.Count == 0) + OnPoolEmpty?.Invoke(this); + } + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/GameObjectItemPool.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/GameObjectItemPool.cs.meta new file mode 100644 index 0000000..6ff1e69 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Foundation/Pools/GameObjectItemPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ae9ef4c7867a4109b97f6921f55dae8d +timeCreated: 1706771153 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GameObjectLazyPool.asmdef b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GameObjectLazyPool.asmdef new file mode 100644 index 0000000..034a76b --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GameObjectLazyPool.asmdef @@ -0,0 +1,30 @@ +{ + "name": "ItemPooling", + "rootNamespace": "ZBase.Foundation.Pooling.ItemPooling", + "references": [ + "UniTask", + "UniTask.Addressables", + "Unity.Addressables", + "Unity.ResourceManager", + "ZBase.Collections.Pooled", + "ZBase.Foundation.Pooling", + "ZBase.Foundation.Pooling.Addressables" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "ZBASE_FOUNDATION_POOLING_ADDRESSABLES" + ], + "versionDefines": [ + { + "name": "com.unity.addressables", + "expression": "", + "define": "ZBASE_FOUNDATION_POOLING_ADDRESSABLES" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GameObjectLazyPool.asmdef.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GameObjectLazyPool.asmdef.meta new file mode 100644 index 0000000..2ae0f44 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GameObjectLazyPool.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1dd4b175824f4ea2928e751802e11a74 +timeCreated: 1706691178 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools.meta new file mode 100644 index 0000000..4d732ea --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ffeb1638715845adaf4bb3261298e4b2 +timeCreated: 1706694323 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions.meta new file mode 100644 index 0000000..6280da2 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8ffdeaa9adba41399df445ca4e9cf0cf +timeCreated: 1706773425 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyAssetRefGameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyAssetRefGameObjectPool.cs new file mode 100644 index 0000000..00d28e2 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyAssetRefGameObjectPool.cs @@ -0,0 +1,34 @@ +using Cysharp.Threading.Tasks; +using UnityEngine; +using UnityEngine.AddressableAssets; +using ZBase.Foundation.Pooling.AddressableAssets; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool.Extensions +{ + + public static class LazyAssetRefGameObjectPool + { + private static GlobalAssetRefGameObjectPool GlobalGameObjectPool => SharedPool.Of(); + + public static async UniTask Rent(string address) + => await GlobalGameObjectPool.Rent(address); + + public static async UniTask Rent(AssetReferenceGameObject gameObjectReference) + => await GlobalGameObjectPool.Rent(gameObjectReference); + + public static async UniTask Rent(AssetRefGameObjectPrefab gameObjectReference) + => await GlobalGameObjectPool.Rent(gameObjectReference); + + public static void Return(GameObject gameObject) + => GlobalGameObjectPool.Return(gameObject); + + public static void Return(AssetRefGameObjectPrefab gameObjectReference, GameObject gameObject) + => GlobalGameObjectPool.Return(gameObjectReference, gameObject); + + public static void ReleaseInstances(int keep, System.Action onReleased = null) + => GlobalGameObjectPool.ReleaseInstances(keep, onReleased); + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void Dispose() => GlobalGameObjectPool.Dispose(); + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyAssetRefGameObjectPool.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyAssetRefGameObjectPool.cs.meta new file mode 100644 index 0000000..6d55e58 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyAssetRefGameObjectPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 159ae9755d504cff866d1b3e1a168b7a +timeCreated: 1706775414 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyGameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyGameObjectPool.cs new file mode 100644 index 0000000..5eee4fc --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyGameObjectPool.cs @@ -0,0 +1,28 @@ +using Cysharp.Threading.Tasks; +using UnityEngine; +using ZBase.Foundation.Pooling.UnityPools; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool.Extensions +{ + + public static class LazyGameObjectPool + { + private static GlobalGameObjectPool GlobalGameObjectPool => SharedPool.Of(); + + public static async UniTask Rent(GameObject gameObjectReference) + => await GlobalGameObjectPool.Rent(gameObjectReference); + public static async UniTask Rent(GameObjectPrefab gameObjectReference) + => await GlobalGameObjectPool.Rent(gameObjectReference); + public static void Return(GameObject gameObject) + => GlobalGameObjectPool.Return(gameObject); + + public static void Return(GameObjectPrefab gameObjectReference, GameObject gameObject) + => GlobalGameObjectPool.Return(gameObjectReference, gameObject); + + public static void ReleaseInstances(int keep, System.Action onReleased = null) + => GlobalGameObjectPool.ReleaseInstances(keep, onReleased); + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void Dispose() => GlobalGameObjectPool.Dispose(); + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyGameObjectPool.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyGameObjectPool.cs.meta new file mode 100644 index 0000000..e56cf43 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/Extensions/LazyGameObjectPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2ecbf73f63cf4edfa28cac9edb131a77 +timeCreated: 1706775264 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalAssetRefGameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalAssetRefGameObjectPool.cs new file mode 100644 index 0000000..85551bb --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalAssetRefGameObjectPool.cs @@ -0,0 +1,93 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Cysharp.Threading.Tasks; +using UnityEngine; +using UnityEngine.AddressableAssets; +using ZBase.Foundation.Pooling.AddressableAssets; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class GlobalAssetRefGameObjectPool : IPool, IShareable + { + private readonly Dictionary _pools = + new(new AssetRefGameObjectPrefabEqualityComparer()); + + private readonly Dictionary _dicTrackingInstancePools = new(); + + private readonly Dictionary _poolKeyCache = new(); + private readonly Dictionary _poolStringKeyCache = new(); + + public async UniTask Rent(string address) + { + if (_poolStringKeyCache.TryGetValue(address, out var key)) + return await Rent(key); + var assetRef = new AssetReferenceGameObject(address); + this._poolStringKeyCache.Add(address, key = new AssetRefGameObjectPrefab { Source = assetRef, }); + return await Rent(key); + } + + public async UniTask Rent(AssetReferenceGameObject gameObjectReference) + { + if (!_poolKeyCache.TryGetValue(gameObjectReference, out var key)) + _poolKeyCache.Add(gameObjectReference, + key = new AssetRefGameObjectPrefab { Source = gameObjectReference, }); + return await Rent(key); + } + + public async UniTask Rent(AssetRefGameObjectPrefab gameObjectReference) + { + if (!_pools.TryGetValue(gameObjectReference, out var pool)) + { + pool = new AssetRefGameObjectItemPool(gameObjectReference); + pool.OnItemDestroyAction += RemoveTrackingItem; + pool.OnReturnAction += RemoveTrackingItem; + this._pools.Add(gameObjectReference, pool); + } + GameObject item = await pool.Rent(); + _dicTrackingInstancePools.Add(item.GetInstanceID(), pool); + return item; + } + + public void Return(GameObject gameObject) + { + if (!gameObject) + return; + if (_dicTrackingInstancePools.TryGetValue(gameObject.GetInstanceID(), out var pool)) + pool.Return(gameObject); + else + Debug.LogWarning($"GameObject {gameObject.name} is not registered in the pool or was already returned."); + } + + public void Return(AssetRefGameObjectPrefab gameObjectReference, GameObject gameObject) + { + if (_pools.TryGetValue(gameObjectReference, out var pool)) + pool.Return(gameObject); + } + + public void ReleaseInstances(int keep, System.Action onReleased = null) + { + foreach (var pool in _pools.Values) + pool.ReleaseInstances(keep, onReleased); + } + + private void RemoveTrackingItem(GameObject gameObject) => _dicTrackingInstancePools.Remove(gameObject.GetInstanceID()); + + public void Dispose() + { + foreach (var pool in _pools.Values) + pool.Dispose(); + _pools.Clear(); + _dicTrackingInstancePools.Clear(); + _poolKeyCache.Clear(); + _poolStringKeyCache.Clear(); + } + + private class AssetRefGameObjectPrefabEqualityComparer : IEqualityComparer + { + public bool Equals([NotNull] AssetRefGameObjectPrefab x, [NotNull] AssetRefGameObjectPrefab y) + => y is { Source: not null } && x is { Source: not null } && + x.Source.AssetGUID.Equals(y.Source.AssetGUID); + public int GetHashCode(AssetRefGameObjectPrefab obj) => obj.Source.AssetGUID.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalAssetRefGameObjectPool.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalAssetRefGameObjectPool.cs.meta new file mode 100644 index 0000000..10af81a --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalAssetRefGameObjectPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9ad6533b2f29433fa6ea93b117498d66 +timeCreated: 1706689315 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalGameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalGameObjectPool.cs new file mode 100644 index 0000000..d910533 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalGameObjectPool.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using UnityEngine; +using ZBase.Foundation.Pooling.UnityPools; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class GlobalGameObjectPool : IPool, IShareable + { + private readonly Dictionary _pools = new(); + private readonly Dictionary _dicTrackingInstancePools = new(); + private readonly Dictionary _poolKeyCache = new(); + + public async UniTask Rent(GameObject gameObjectReference) + { + var hash = gameObjectReference.GetInstanceID(); + if (!_poolKeyCache.TryGetValue(hash, out var key)) + this._poolKeyCache.Add(hash, key = new GameObjectPrefab { Source = gameObjectReference }); + return await Rent(key); + } + + public async UniTask Rent(GameObjectPrefab gameObjectReference) + { + var instanceID = gameObjectReference.Source.GetInstanceID(); + if (!_pools.TryGetValue(instanceID, out var pool)) + { + if (gameObjectReference.Source.scene.IsValid()) + throw new Exception($"Non Prefab not supported {gameObjectReference.Source.name}"); + pool = new GameObjectItemPool(gameObjectReference); + pool.OnReturnAction += RemoveTrackingItem; + pool.OnItemDestroyAction += RemoveTrackingItem; + pool.OnPoolEmpty += OnPoolEmpty; + this._pools.Add(instanceID, pool); + } + + GameObject item = await pool.Rent(); + this._dicTrackingInstancePools.Add(item.GetInstanceID(), pool); + return item; + } + + public void Return(GameObject gameObject) + { + if (!gameObject) + return; + if (this._dicTrackingInstancePools.TryGetValue(gameObject.GetInstanceID(), out var pool)) + pool.Return(gameObject); + else + Debug.LogWarning( + $"GameObject {gameObject.name} is not registered in the pool or was already returned."); + } + + public void Return(GameObjectPrefab gameObjectReference, GameObject gameObject) + { + if (_pools.TryGetValue(gameObjectReference.Source.GetInstanceID(), out var pool)) + pool.Return(gameObject); + } + + public void ReleaseInstances(int keep, Action onReleased = null) + { + foreach (var pool in _pools.Values) + pool.ReleaseInstances(keep, onReleased); + } + + private void OnPoolEmpty(GameObjectItemPool pool) + { + pool.Dispose(); + this._pools.Remove(pool.ID); + RemoveReference(pool.ID); + RemoveCacheKey(pool.ID); + } + + private void RemoveReference(int poolID) + { + foreach (var keyPair in this._dicTrackingInstancePools) + { + if (keyPair.Value.ID != poolID) + continue; + this._dicTrackingInstancePools.Remove(keyPair.Key); + Debug.LogWarning($"Pool {poolID} is empty and removed from tracking"); + break; + } + } + + private void RemoveCacheKey(int poolID) + { + foreach (var keyPair in _poolKeyCache) + { + if (keyPair.Value.Source.GetInstanceID() != poolID) + continue; + this._poolKeyCache.Remove(keyPair.Key); + break; + } + } + + private void RemoveTrackingItem(GameObject gameObject) => + this._dicTrackingInstancePools.Remove(gameObject.GetInstanceID()); + + public void Dispose() + { + foreach (var pool in _pools.Values) + pool.Dispose(); + _pools.Clear(); + _dicTrackingInstancePools.Clear(); + _poolKeyCache.Clear(); + } + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalGameObjectPool.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalGameObjectPool.cs.meta new file mode 100644 index 0000000..b55c660 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/GlobalPools/GlobalGameObjectPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0f2065ce9fcb408daed7dc486453f99a +timeCreated: 1706771113 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items.meta new file mode 100644 index 0000000..0c269b9 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bf77127ed4474e0d8bbf4854cac716ab +timeCreated: 1706691451 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/AssetRefGameObjectPoolItem.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/AssetRefGameObjectPoolItem.cs new file mode 100644 index 0000000..eb76ae5 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/AssetRefGameObjectPoolItem.cs @@ -0,0 +1,8 @@ +using ZBase.Foundation.Pooling.AddressableAssets; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class AssetRefGameObjectPoolItem : PoolItem + { + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/AssetRefGameObjectPoolItem.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/AssetRefGameObjectPoolItem.cs.meta new file mode 100644 index 0000000..743e2e4 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/AssetRefGameObjectPoolItem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 03493b6a82c244069e0431cf41601291 +timeCreated: 1706695936 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/GameObjectPoolItem.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/GameObjectPoolItem.cs new file mode 100644 index 0000000..8564c46 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/GameObjectPoolItem.cs @@ -0,0 +1,16 @@ +using System; +using UnityEngine; +using ZBase.Foundation.Pooling.UnityPools; +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class GameObjectPoolItem : PoolItem + { + public event Action OnItemDestroy; + + protected override void OnDestroy() + { + base.OnDestroy(); + this.OnItemDestroy?.Invoke(this.gameObject); + } + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/GameObjectPoolItem.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/GameObjectPoolItem.cs.meta new file mode 100644 index 0000000..fb28cc7 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/GameObjectPoolItem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2498a09f8bdf432e9b248f3f14dec53d +timeCreated: 1706770559 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItem.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItem.cs new file mode 100644 index 0000000..b7776e0 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItem.cs @@ -0,0 +1,42 @@ +using System; +using Cysharp.Threading.Tasks; +using UnityEngine; +using ZBase.Foundation.Pooling.UnityPools; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class PoolItem : MonoBehaviour where TPrefab : IPrefab + { + private float _lifeTime; + private UnityPool _pool; + + private void Awake() + { + var setUp = GetComponent(); + if (setUp != null) + _lifeTime = setUp.LifeTime; + } + + private void OnEnable() + { + if (_lifeTime <= 0) + return; + StartDeSpawn().Forget(); + } + + private async UniTask StartDeSpawn() + { + if (_lifeTime <= 0) + return; + if (await UniTask + .Delay(TimeSpan.FromSeconds(_lifeTime), cancellationToken: this.GetCancellationTokenOnDestroy()) + .SuppressCancellationThrow()) + return; + _pool?.Return(gameObject); + } + + public void SetUp(UnityPool pool) => _pool = pool; + + protected virtual void OnDestroy() => _pool?.OnPoolItemDestroy(gameObject); + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItem.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItem.cs.meta new file mode 100644 index 0000000..6a37029 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ae2b5ebcb0b54c60b5f24757dee4cc8d +timeCreated: 1706691481 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItemAutoDeSpawnSetUp.cs b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItemAutoDeSpawnSetUp.cs new file mode 100644 index 0000000..bb5d4cd --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItemAutoDeSpawnSetUp.cs @@ -0,0 +1,10 @@ +using UnityEngine; + +namespace ZBase.Foundation.Pooling.GameObjectItem.LazyPool +{ + public class PoolItemAutoDeSpawnSetUp : MonoBehaviour + { + [SerializeField] private float _lifeTime; + public float LifeTime => _lifeTime; + } +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItemAutoDeSpawnSetUp.cs.meta b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItemAutoDeSpawnSetUp.cs.meta new file mode 100644 index 0000000..a3efd47 --- /dev/null +++ b/Packages/ZBase.Foundation.Pooling/GameObjectLazyPool/Items/PoolItemAutoDeSpawnSetUp.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3ccfd0da2bab4198bf7a2413d826a967 +timeCreated: 1706772086 \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Behaviours/AssetRefGameObjectPoolBehaviour.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Behaviours/AssetRefGameObjectPoolBehaviour.cs index 37fe144..0694246 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Behaviours/AssetRefGameObjectPoolBehaviour.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Behaviours/AssetRefGameObjectPoolBehaviour.cs @@ -3,11 +3,7 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { - public class AssetRefGameObjectPoolBehaviour - : UnityPoolBehaviour< - GameObject - , AssetRefGameObjectPrefab - , AssetRefGameObjectPool + public class AssetRefGameObjectPoolBehaviour : UnityPoolBehaviour< GameObject , AssetRefGameObjectPrefab , AssetRefGameObjectPool > { } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool.cs index 1c8663a..63850ac 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool.cs @@ -5,23 +5,24 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AddressGameObjectPool - : AddressGameObjectPool + public class AddressGameObjectPool : AddressGameObjectPool { public AddressGameObjectPool() - : base() - { } + { + } public AddressGameObjectPool(AddressGameObjectPrefab prefab) : base(prefab) - { } + { + } - public AddressGameObjectPool(UniqueQueue queue) - : base(queue) - { } + public AddressGameObjectPool(UniqueQueue queue) : base(queue) + { + } - public AddressGameObjectPool(UniqueQueue queue, AddressGameObjectPrefab prefab) - : base(queue, prefab) - { } + public AddressGameObjectPool(UniqueQueue queue, AddressGameObjectPrefab prefab) : base(queue, + prefab) + { + } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool{TPrefab}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool{TPrefab}.cs index d39e19d..0a5d3e6 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool{TPrefab}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AddressGameObjectPool{TPrefab}.cs @@ -6,24 +6,22 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AddressGameObjectPool - : GameObjectPool - where TPrefab : AddressGameObjectPrefab + public class AddressGameObjectPool : GameObjectPool where TPrefab : AddressGameObjectPrefab { public AddressGameObjectPool() - : base() - { } + { + } - public AddressGameObjectPool(TPrefab prefab) - : base(prefab) - { } + public AddressGameObjectPool(TPrefab prefab) : base(prefab) + { + } - public AddressGameObjectPool(UniqueQueue queue) - : base(queue) - { } + public AddressGameObjectPool(UniqueQueue queue) : base(queue) + { + } - public AddressGameObjectPool(UniqueQueue queue, TPrefab prefab) - : base(queue, prefab) - { } + public AddressGameObjectPool(UniqueQueue queue, TPrefab prefab) : base(queue, prefab) + { + } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefComponentPool{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefComponentPool{T}.cs index 1cf7aa8..8ac4bf5 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefComponentPool{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefComponentPool{T}.cs @@ -1,29 +1,27 @@ using System; using UnityEngine; -using ZBase.Foundation.Pooling; using ZBase.Foundation.Pooling.UnityPools; namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AssetRefComponentPool - : ComponentPool> - where T : Component + public class AssetRefComponentPool : ComponentPool> where T : Component { public AssetRefComponentPool() - : base() - { } + { + } - public AssetRefComponentPool(AssetRefComponentPrefab prefab) - : base(prefab) - { } + public AssetRefComponentPool(AssetRefComponentPrefab prefab) : base(prefab) + { + } - public AssetRefComponentPool(UniqueQueue queue) - : base(queue) - { } + public AssetRefComponentPool(UniqueQueue queue) : base(queue) + { + } public AssetRefComponentPool(UniqueQueue queue, AssetRefComponentPrefab prefab) : base(queue, prefab) - { } + { + } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefGameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefGameObjectPool.cs index 2d93cf9..a82a9e3 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefGameObjectPool.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Pools/AssetRefGameObjectPool.cs @@ -1,28 +1,27 @@ using System; using UnityEngine; -using ZBase.Foundation.Pooling; using ZBase.Foundation.Pooling.UnityPools; namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AssetRefGameObjectPool - : GameObjectPool + public class AssetRefGameObjectPool : GameObjectPool { public AssetRefGameObjectPool() - : base() - { } + { + } - public AssetRefGameObjectPool(AssetRefGameObjectPrefab prefab) - : base(prefab) - { } + public AssetRefGameObjectPool(AssetRefGameObjectPrefab prefab) : base(prefab) + { + } - public AssetRefGameObjectPool(UniqueQueue queue) - : base(queue) - { } + public AssetRefGameObjectPool(UniqueQueue queue) : base(queue) + { + } public AssetRefGameObjectPool(UniqueQueue queue, AssetRefGameObjectPrefab prefab) : base(queue, prefab) - { } + { + } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressGameObjectPrefab.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressGameObjectPrefab.cs index 6a7793f..a244cfe 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressGameObjectPrefab.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressGameObjectPrefab.cs @@ -8,22 +8,12 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AddressGameObjectPrefab - : AddressPrefab + public class AddressGameObjectPrefab : AddressPrefab { protected override async UniTask Instantiate( - string source - , Transform parent - , CancellationToken cancelToken - ) + string source, Transform parent, CancellationToken cancelToken = default) { - AsyncOperationHandle handle; - - if (parent) - handle = Addressables.InstantiateAsync(source, parent); - else - handle = Addressables.InstantiateAsync(source); - + var handle = parent ? Addressables.InstantiateAsync(source, parent) : Addressables.InstantiateAsync(source); return await handle.WithCancellation(cancelToken); } @@ -33,4 +23,4 @@ public override void Release(GameObject instance) Addressables.ReleaseInstance(instance); } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressPrefab{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressPrefab{T}.cs index 09f4521..86bd866 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressPrefab{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AddressPrefab{T}.cs @@ -4,9 +4,7 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public abstract class AddressPrefab - : UnityPrefab - where T : UnityEngine.Object + public abstract class AddressPrefab : UnityPrefab where T : UnityEngine.Object { } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefComponentPrefab{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefComponentPrefab{T}.cs index d640b5e..ba03c7c 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefComponentPrefab{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefComponentPrefab{T}.cs @@ -8,25 +8,15 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AssetRefComponentPrefab - : AssetRefPrefab + public class AssetRefComponentPrefab : AssetRefPrefab where T : Component { - protected override async UniTask Instantiate( - AssetReferenceGameObject source - , Transform parent - , CancellationToken cancelToken = default - ) + protected override async UniTask Instantiate(AssetReferenceGameObject source, Transform parent, + CancellationToken cancelToken = default) { - AsyncOperationHandle handle; - - if (parent) - handle = source.InstantiateAsync(parent, true); - else - handle = source.InstantiateAsync(); - + AsyncOperationHandle handle = + parent ? source.InstantiateAsync(parent, true) : source.InstantiateAsync(); var gameObject = await handle.WithCancellation(cancelToken); - return gameObject.GetComponent(); } @@ -36,4 +26,4 @@ public override void Release(T instance) Source.ReleaseInstance(instance.gameObject); } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefGameObjectPrefab.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefGameObjectPrefab.cs index 394e6a0..5146873 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefGameObjectPrefab.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefGameObjectPrefab.cs @@ -8,22 +8,13 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public class AssetRefGameObjectPrefab - : AssetRefPrefab + public class AssetRefGameObjectPrefab : AssetRefPrefab { protected override async UniTask Instantiate( - AssetReferenceGameObject source - , Transform parent - , CancellationToken cancelToken - ) + AssetReferenceGameObject source, Transform parent, CancellationToken cancelToken = default) { - AsyncOperationHandle handle; - - if (parent) - handle = source.InstantiateAsync(parent, true); - else - handle = source.InstantiateAsync(); - + AsyncOperationHandle handle = + parent ? source.InstantiateAsync(parent, true) : source.InstantiateAsync(); return await handle.WithCancellation(cancelToken); } @@ -33,4 +24,4 @@ public override void Release(GameObject instance) Source.ReleaseInstance(instance); } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefPrefab{T,TAssetRef}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefPrefab{T,TAssetRef}.cs index fc415d2..45bc0fa 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefPrefab{T,TAssetRef}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling.Addressables/Foundation/Prefabs/AssetRefPrefab{T,TAssetRef}.cs @@ -5,10 +5,7 @@ namespace ZBase.Foundation.Pooling.AddressableAssets { [Serializable] - public abstract class AssetRefPrefab - : UnityPrefab - where T : UnityEngine.Object - where TAssetRef : AssetReference + public abstract class AssetRefPrefab : UnityPrefab where T : UnityEngine.Object where TAssetRef : AssetReference { } } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/Interfaces/IReturnable{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/Interfaces/IReturnable{T}.cs index 4bcd506..6ee3b0c 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/Interfaces/IReturnable{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/Interfaces/IReturnable{T}.cs @@ -1,6 +1,6 @@ namespace ZBase.Foundation.Pooling { - public interface IReturnable + public interface IReturnable { void Return(T instance); } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/SharedPool.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/SharedPool.cs index c139761..7ddbe13 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/SharedPool.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/SharedPool.cs @@ -6,26 +6,14 @@ namespace ZBase.Foundation.Pooling public static class SharedPool { [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Of() where T : IPool, IShareable, new() - => SharedInstance.Instance; + public static T Of() where T : IPool, IShareable, new() => SharedInstance.Instance; private static class SharedInstance where T : IPool, IShareable, new() { - private static T s_instance; - - public static T Instance => s_instance; - - static SharedInstance() - { - Init(); - } - - /// + public static T Instance { get; private set; } + static SharedInstance() => Init(); [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] - static void Init() - { - s_instance = new T(); - } + static void Init() => Instance = new T(); } } } \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{TKey,TValue}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{TKey,TValue}.cs index 2b6082c..8812242 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{TKey,TValue}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{TKey,TValue}.cs @@ -38,27 +38,23 @@ public bool TryEnqueue(TKey key, TValue value) { if (key is null || value is null) return false; - - if (_unique.ContainsKey(key)) + if (!this._unique.TryAdd(key, value)) return false; - - _unique.Add(key, value); _queue.Enqueue(key); return true; } - public bool TryDequeue(out TKey key, out TValue value) + public bool TryDequeue(out TValue value) { - if (_queue.TryDequeue(out key) && _unique.TryGetValue(key, out value)) - { - _unique.Remove(key); - return true; - } - value = default; + while (_queue.Count > 0) + if (_queue.TryDequeue(out var key) && this._unique.Remove(key, out value) && value != null) + return true; return false; } + internal void Remove(TKey key) => this._unique.Remove(key, out _); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(TKey key) => _unique.ContainsKey(key); @@ -67,4 +63,4 @@ public bool Contains(TKey key) public bool Contains(in KVPair item) => _unique.ContainsKey(item.Key); } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{T}.cs index 4be7ffd..9532014 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/Foundation/Common/UniqueQueue{T}.cs @@ -9,7 +9,6 @@ public bool TryEnqueue(T item) => TryEnqueue(item, item); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryDequeue(out T item) - => TryDequeue(out var _, out item); + public bool TryDequeue(out T item) => base.TryDequeue(out item); } } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrefab.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrefab.cs index e354b95..10a7814 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrefab.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrefab.cs @@ -28,7 +28,7 @@ public ScriptableSource Source set => _source = value; } - public int PrepoolAmount + public int PrePoolAmount { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _prepoolAmount; diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrepooler.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrepooler.cs index 0cbcafc..450b8bf 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrepooler.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Common/UnityObjectPrepooler.cs @@ -5,13 +5,13 @@ namespace ZBase.Foundation.Pooling.ScriptablePools { - public struct UnityObjectPrepooler - : IPrepooler > { - public async UniTask Prepool( + public async UniTask PrePool( UnityObjectPrefab prefab , IReturnable pool , Transform defaultParent @@ -24,13 +24,13 @@ UnityObjectPrefab prefab if (pool == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.pool); - if (prefab.PrepoolAmount <= 0) + if (prefab.PrePoolAmount <= 0) return; if (prefab.Parent == false && defaultParent) prefab.Parent = defaultParent; - for (int i = 0, count = prefab.PrepoolAmount; i < count; i++) + for (int i = 0, count = prefab.PrePoolAmount; i < count; i++) { var instance = await prefab.Instantiate(cancelToken); pool.Return(instance); diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Pools/ScriptablePool{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Pools/ScriptablePool{T}.cs index 24e9e13..55c3f75 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Pools/ScriptablePool{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/ScriptablePools/Pools/ScriptablePool{T}.cs @@ -17,8 +17,8 @@ public class ScriptablePool [SerializeField] private bool _prepoolOnStart = false; - private readonly UnityObjectPool _pool = new UnityObjectPool(); - private readonly UnityObjectPrepooler _prepooler = default; + private readonly UnityObjectPool _pool = new(); + private readonly UnityObjectPrePool _prePool = default; public bool PrepoolOnStart { @@ -57,7 +57,7 @@ public void Return(T instance) [MethodImpl(MethodImplOptions.AggressiveInlining)] public async UniTask Prepool(CancellationToken cancelToken) - => await _prepooler.Prepool(_prefab, _pool, Parent, cancelToken); + => await this._prePool.PrePool(_prefab, _pool, Parent, cancelToken); public void ReleaseInstances(int keep, Action onReleased = null) { diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/System.Collections.Generic/HashSetPool.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/System.Collections.Generic/HashSetPool.cs index 303f08b..ae76633 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/System.Collections.Generic/HashSetPool.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/System.Collections.Generic/HashSetPool.cs @@ -3,20 +3,9 @@ namespace System.Collections.Generic.Pooling { - public class HashSetPool - : Pool - , DefaultConstructorInstantiator>> + public sealed class HashSetPool : Pool, DefaultConstructorInstantiator>> { - public HashSetPool() - : base() - { } - - public HashSetPool(UniqueQueue> queue) - : base(queue) - { } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected override void ReturnPreprocess(HashSet instance) - => instance.Clear(); + protected override void ReturnPreprocess(HashSet instance) => instance.Clear(); } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Behaviours/UnityPoolBehaviour{T,TPrefab,TPool}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Behaviours/UnityPoolBehaviour{T,TPrefab,TPool}.cs index 69d97f5..05d575f 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Behaviours/UnityPoolBehaviour{T,TPrefab,TPool}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Behaviours/UnityPoolBehaviour{T,TPrefab,TPool}.cs @@ -23,7 +23,7 @@ public bool PrepoolOnStart set => _prepoolOnStart = value; } - private readonly UnityPrepooler _prepooler = default; + private readonly UnityPrePool _prePool = default; protected void Awake() { @@ -46,7 +46,7 @@ protected async UniTask Start() [MethodImpl(MethodImplOptions.AggressiveInlining)] public async UniTask Prepool(CancellationToken cancelToken) - => await _prepooler.Prepool(Pool.Prefab, Pool, this.transform, cancelToken); + => await this._prePool.PrePool(Pool.Prefab, Pool, this.transform, cancelToken); protected virtual void OnAwake() { } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab.cs index f0c28e2..3c97cca 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab.cs @@ -2,6 +2,6 @@ { public interface IPrefab { - int PrepoolAmount { get; set; } + int PrePoolAmount { get; set; } } } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab{T}.cs index d115ae0..e54f0c8 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrefab{T}.cs @@ -1,7 +1,6 @@ namespace ZBase.Foundation.Pooling.UnityPools { - public interface IPrefab - : IPrefab, IAsyncInstantiable, IReleasable, IHasParent + public interface IPrefab : IPrefab, IAsyncInstantiable, IReleasable, IHasParent { } } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrepooler{T,TPrefab,TPool}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrepooler{T,TPrefab,TPool}.cs index 2983538..95c01dc 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrepooler{T,TPrefab,TPool}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Common/Interfaces/IPrepooler{T,TPrefab,TPool}.cs @@ -4,11 +4,9 @@ namespace ZBase.Foundation.Pooling.UnityPools { - public interface IPrepooler - where TPrefab : IPrefab - where TPool : IReturnable + public interface IPrePool where TPrefab : IPrefab where TPool : IReturnable { - UniTask Prepool( + UniTask PrePool( TPrefab prefab , TPool pool , Transform defaultParent diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/ComponentPool{T,TPrefab}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/ComponentPool{T,TPrefab}.cs index 4861d66..7bdb31d 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/ComponentPool{T,TPrefab}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/ComponentPool{T,TPrefab}.cs @@ -5,28 +5,21 @@ namespace ZBase.Foundation.Pooling.UnityPools { [Serializable] - public class ComponentPool - : UnityPool - where T : UnityEngine.Component - where TPrefab : IPrefab + public class ComponentPool : UnityPool where T : Component where TPrefab : IPrefab { [SerializeField] private bool _dontApplyPrefabParentOnReturn; public ComponentPool() - : base() { } - public ComponentPool(TPrefab prefab) - : base(prefab) + public ComponentPool(TPrefab prefab) : base(prefab) { } - public ComponentPool(UniqueQueue queue) - : base(queue) + public ComponentPool(UniqueQueue queue) : base(queue) { } - public ComponentPool(UniqueQueue queue, TPrefab prefab) - : base(queue, prefab) + public ComponentPool(UniqueQueue queue, TPrefab prefab) : base(queue, prefab) { } public bool DontApplyPrefabParentOnReturn diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool.cs index 9f79c7f..c1dd54e 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool.cs @@ -4,23 +4,15 @@ namespace ZBase.Foundation.Pooling.UnityPools { [Serializable] - public class GameObjectPool - : GameObjectPool + public class GameObjectPool : GameObjectPool { - public GameObjectPool() - : base() - { } + public GameObjectPool() { } - public GameObjectPool(GameObjectPrefab prefab) - : base(prefab) - { } + public GameObjectPool(GameObjectPrefab prefab) : base(prefab) { } - public GameObjectPool(UniqueQueue queue) - : base(queue) - { } + public GameObjectPool(UniqueQueue queue): base(queue){ } - public GameObjectPool(UniqueQueue queue, GameObjectPrefab prefab) - : base(queue, prefab) + public GameObjectPool(UniqueQueue queue, GameObjectPrefab prefab): base(queue, prefab) { } } } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool{TPrefab}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool{TPrefab}.cs index 5db022c..ee95fe4 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool{TPrefab}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/GameObjectPool{TPrefab}.cs @@ -5,49 +5,37 @@ namespace ZBase.Foundation.Pooling.UnityPools { [Serializable] - public class GameObjectPool - : UnityPool - where TPrefab : IPrefab + public class GameObjectPool : UnityPool where TPrefab : IPrefab { - [SerializeField] - private bool _dontApplyPrefabParentOnReturn; + [SerializeField] private bool _dontApplyPrefabParentOnReturn; + public event Action OnReturnAction; public GameObjectPool() - : base() - { } - - public GameObjectPool(TPrefab prefab) - : base(prefab) - { } + { + } - public GameObjectPool(UniqueQueue queue) - : base(queue) - { } + public GameObjectPool(TPrefab prefab) : base(prefab) + { + } - public GameObjectPool(UniqueQueue queue, TPrefab prefab) - : base(queue, prefab) - { } + public GameObjectPool(UniqueQueue queue) : base(queue) + { + } - public bool DontApplyPrefabParentOnReturn + public GameObjectPool(UniqueQueue queue, TPrefab prefab) : base(queue, prefab) { - get => _dontApplyPrefabParentOnReturn; - set => _dontApplyPrefabParentOnReturn = value; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected override void ReturnPreprocess(GameObject instance) { - if (instance == false) - { + if (!instance) return; - } - instance.SetActive(false); - if (_dontApplyPrefabParentOnReturn == false && Prefab != null) - { instance.transform.SetParent(Prefab.Parent); - } + OnReturnAction?.Invoke(instance); } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/UnityPool{T,TPrefab}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/UnityPool{T,TPrefab}.cs index 439ff5f..9e801ce 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/UnityPool{T,TPrefab}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Pools/UnityPool{T,TPrefab}.cs @@ -8,19 +8,15 @@ namespace ZBase.Foundation.Pooling.UnityPools { [Serializable] public class UnityPool - : IUnityPool, IShareable, IDisposable - where T : UnityEngine.Object - where TPrefab : IPrefab + : IUnityPool, IShareable, IDisposable where T : UnityEngine.Object where TPrefab : IPrefab { + public event Action OnItemDestroyAction; + private readonly UniqueQueue _queue; - [SerializeField] - private TPrefab _prefab; + [SerializeField] private TPrefab _prefab; - public UnityPool() - { - _queue = new UniqueQueue(); - } + public UnityPool() => _queue = new UniqueQueue(); public UnityPool(TPrefab prefab) { @@ -28,10 +24,7 @@ public UnityPool(TPrefab prefab) _prefab = prefab ?? throw new ArgumentNullException(nameof(prefab)); } - public UnityPool(UniqueQueue queue) - { - _queue = queue ?? throw new ArgumentNullException(nameof(queue)); - } + public UnityPool(UniqueQueue queue) => _queue = queue ?? throw new ArgumentNullException(nameof(queue)); public UnityPool(UniqueQueue queue, TPrefab prefab) { @@ -51,19 +44,15 @@ public TPrefab Prefab [MethodImpl(MethodImplOptions.AggressiveInlining)] public int Count() => _queue.Count; - public void Dispose() - { - _queue.Dispose(); - } + public void Dispose() => _queue.Dispose(); /// public void ReleaseInstances(int keep, Action onReleased = null) { var countRemove = _queue.Count - keep; - while (countRemove > 0) { - if (_queue.TryDequeue(out var _, out var instance)) + if (_queue.TryDequeue(out var instance)) { if (onReleased != null) onReleased(instance); @@ -77,30 +66,42 @@ public void ReleaseInstances(int keep, Action onReleased = null) public async UniTask Rent() { - if (_queue.TryDequeue(out var _, out var instance)) + if (_queue.TryDequeue(out var instance)) return instance; - - return await _prefab.Instantiate(); + instance = await _prefab.Instantiate(); + ProcessNewInstance(instance); + return instance; } public async UniTask Rent(CancellationToken cancelToken) { - if (_queue.TryDequeue(out var _, out var instance)) + if (_queue.TryDequeue(out var instance)) return instance; - - return await _prefab.Instantiate(cancelToken); + instance = await _prefab.Instantiate(cancelToken); + ProcessNewInstance(instance); + return instance; } + protected virtual void ProcessNewInstance(T instance) { } + public void Return(T instance) { - if (instance == false) + if (!instance) return; - ReturnPreprocess(instance); _queue.TryEnqueue(instance.GetInstanceID(), instance); } + + public virtual void OnPoolItemDestroy(T instance) + { + if (!instance) + return; + _queue.Remove(instance.GetInstanceID()); + _prefab.Release(instance); + OnItemDestroyAction?.Invoke(instance); + } [MethodImpl(MethodImplOptions.AggressiveInlining)] protected virtual void ReturnPreprocess(T instance) { } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/ComponentPrefab{T}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/ComponentPrefab{T}.cs index 56aafa3..a7fde5a 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/ComponentPrefab{T}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/ComponentPrefab{T}.cs @@ -6,8 +6,7 @@ namespace ZBase.Foundation.Pooling.UnityPools { [Serializable] - public class ComponentPrefab : UnityPrefab - where T : UnityEngine.Component + public class ComponentPrefab : UnityPrefab where T : Component { protected override async UniTask Instantiate( T source diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/GameObjectPrefab.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/GameObjectPrefab.cs index 0810064..8bbf73f 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/GameObjectPrefab.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/GameObjectPrefab.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading; using Cysharp.Threading.Tasks; using UnityEngine; @@ -9,18 +10,11 @@ namespace ZBase.Foundation.Pooling.UnityPools public class GameObjectPrefab : UnityPrefab { protected override async UniTask Instantiate( - GameObject source - , Transform parent - , CancellationToken cancelToken - ) + GameObject source, Transform parent, CancellationToken cancelToken = default) { - GameObject instance; - - if (parent) - instance = UnityEngine.Object.Instantiate(Source, parent, true); - else - instance = UnityEngine.Object.Instantiate(Source); - + GameObject instance = parent + ? UnityEngine.Object.Instantiate(this.Source, parent, true) + : UnityEngine.Object.Instantiate(this.Source); return await UniTask.FromResult(instance); } diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/UnityPrefab{T,TSource}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/UnityPrefab{T,TSource}.cs index eb7b92f..bbccddd 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/UnityPrefab{T,TSource}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prefabs/UnityPrefab{T,TSource}.cs @@ -7,24 +7,16 @@ namespace ZBase.Foundation.Pooling.UnityPools { [Serializable] - public abstract class UnityPrefab - : IPrefab - where T : class + public abstract class UnityPrefab : IPrefab where T : class { - [SerializeField] - private TSource _source; - - [SerializeField] - private Transform _parent; - - [SerializeField] - private int _prepoolAmount; + [SerializeField] private TSource _source; + [SerializeField] private Transform _parent; + [SerializeField] private int _prePoolAmount; public TSource Source { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _source; - [MethodImpl(MethodImplOptions.AggressiveInlining)] set => _source = value; } @@ -33,25 +25,22 @@ public Transform Parent { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _parent; - [MethodImpl(MethodImplOptions.AggressiveInlining)] set => _parent = value; } - public int PrepoolAmount + public int PrePoolAmount { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _prepoolAmount; - + get => this._prePoolAmount; [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => _prepoolAmount = value; + set => this._prePoolAmount = value; } public async UniTask Instantiate() { if (_source is null) throw new NullReferenceException(nameof(Source)); - return await Instantiate(Source, Parent); } @@ -59,17 +48,15 @@ public async UniTask Instantiate(CancellationToken cancelToken) { if (_source is null) throw new NullReferenceException(nameof(Source)); - return await Instantiate(Source, Parent, cancelToken); } [MethodImpl(MethodImplOptions.AggressiveInlining)] protected abstract UniTask Instantiate( - TSource source + TSource source , Transform parent - , CancellationToken cancelToken = default) - ; + , CancellationToken cancelToken = default); public abstract void Release(T instance); } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prepoolers/UnityPrepooler{T,TPrefab,TPool}.cs b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prepoolers/UnityPrepooler{T,TPrefab,TPool}.cs index 0f06315..5045152 100644 --- a/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prepoolers/UnityPrepooler{T,TPrefab,TPool}.cs +++ b/Packages/ZBase.Foundation.Pooling/ZBase.Foundation.Pooling/UnityPools/Prepoolers/UnityPrepooler{T,TPrefab,TPool}.cs @@ -4,36 +4,35 @@ namespace ZBase.Foundation.Pooling.UnityPools { - public struct UnityPrepooler - : IPrepooler - where T : UnityEngine.Object - where TPrefab : IPrefab - where TPool : IReturnable + public struct UnityPrePool + : IPrePool where T : Object where TPrefab : IPrefab where TPool : IReturnable { - public async UniTask Prepool( - TPrefab prefab - , TPool pool - , Transform defaultParent - , CancellationToken cancelToken = default - ) + public readonly async UniTask PrePool( + TPrefab prefab , TPool pool , Transform defaultParent , CancellationToken cancelToken = default ) { if (prefab == null) + { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.prefab); + return; + } if (pool == null) + { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.pool); + return; + } - if (prefab.PrepoolAmount <= 0) + if (prefab.PrePoolAmount <= 0) return; if (prefab.Parent == false && defaultParent) prefab.Parent = defaultParent; - for (int i = 0, count = prefab.PrepoolAmount; i < count; i++) + for (int i = 0; i < prefab.PrePoolAmount; i++) { var instance = await prefab.Instantiate(cancelToken); pool.Return(instance); } } } -} +} \ No newline at end of file diff --git a/Packages/ZBase.Foundation.Pooling/package.json b/Packages/ZBase.Foundation.Pooling/package.json index 26ad728..a33521a 100644 --- a/Packages/ZBase.Foundation.Pooling/package.json +++ b/Packages/ZBase.Foundation.Pooling/package.json @@ -1,9 +1,9 @@ { "name": "com.zbase.foundation.pooling", "displayName": "ZBase.Foundation.Pooling", - "version": "2.3.1", + "version": "2.3.10", "unity": "2021.3", - "documentationUrl": "https://github.com/Zitga-Tech/ZBase.Foundation.Pooling/blob/main/README.md", + "documentationUrl": "https://github.com/WolffunGame/Unity.Pooling/blob/main/README.md", "dependencies": { "com.cysharp.unitask": "2.3.3", "com.zbase.collections.pooled": "2.8.1" diff --git a/Packages/manifest.json b/Packages/manifest.json index 2032235..d95f48f 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,14 +1,16 @@ { "dependencies": { - "com.cysharp.unitask": "2.3.3", - "com.unity.addressables": "1.19.19", - "com.unity.ide.rider": "3.0.18", - "com.unity.ide.visualstudio": "2.0.16", + "com.cysharp.unitask": "2.5.3", + "com.unity.addressables": "1.21.12", + "com.unity.ai.navigation": "1.1.4", + "com.unity.ide.rider": "3.0.24", + "com.unity.ide.visualstudio": "2.0.18", "com.unity.ide.vscode": "1.2.5", - "com.unity.render-pipelines.universal": "12.1.8", + "com.unity.render-pipelines.universal": "12.1.12", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", - "com.unity.timeline": "1.6.4", + "com.unity.timeline": "1.7.5", + "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.6", "com.unity.ugui": "1.0.0", "com.zbase.collections.pooled": "2.8.1", "org.nuget.system.runtime.compilerservices.unsafe": "6.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index f3cb63f..fde5219 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,18 +1,18 @@ { "dependencies": { "com.cysharp.unitask": { - "version": "2.3.3", + "version": "2.5.3", "depth": 0, "source": "registry", "dependencies": {}, "url": "https://package.openupm.com" }, "com.unity.addressables": { - "version": "1.19.19", + "version": "1.21.12", "depth": 0, "source": "registry", "dependencies": { - "com.unity.scriptablebuildpipeline": "1.19.6", + "com.unity.scriptablebuildpipeline": "1.21.5", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", @@ -21,8 +21,17 @@ }, "url": "https://packages.unity.com" }, + "com.unity.ai.navigation": { + "version": "1.1.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.ai": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.burst": { - "version": "1.8.2", + "version": "1.8.4", "depth": 1, "source": "registry", "dependencies": { @@ -38,7 +47,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.18", + "version": "3.0.24", "depth": 0, "source": "registry", "dependencies": { @@ -47,7 +56,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.16", + "version": "2.0.18", "depth": 0, "source": "registry", "dependencies": { @@ -70,7 +79,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "12.1.8", + "version": "12.1.12", "depth": 1, "source": "builtin", "dependencies": { @@ -80,18 +89,18 @@ } }, "com.unity.render-pipelines.universal": { - "version": "12.1.8", + "version": "12.1.12", "depth": 0, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", - "com.unity.burst": "1.8.2", - "com.unity.render-pipelines.core": "12.1.8", - "com.unity.shadergraph": "12.1.8" + "com.unity.burst": "1.8.4", + "com.unity.render-pipelines.core": "12.1.12", + "com.unity.shadergraph": "12.1.12" } }, "com.unity.scriptablebuildpipeline": { - "version": "1.20.1", + "version": "1.21.5", "depth": 1, "source": "registry", "dependencies": {}, @@ -105,14 +114,30 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "12.1.8", + "version": "12.1.12", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "12.1.8", + "com.unity.render-pipelines.core": "12.1.12", "com.unity.searcher": "4.9.1" } }, + "com.unity.sysroot": { + "version": "2.0.7", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.sysroot.linux-x86_64": { + "version": "2.0.6", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.sysroot": "2.0.7" + }, + "url": "https://packages.unity.com" + }, "com.unity.test-framework": { "version": "1.1.33", "depth": 0, @@ -134,7 +159,7 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.6.4", + "version": "1.7.5", "depth": 0, "source": "registry", "dependencies": { @@ -145,6 +170,16 @@ }, "url": "https://packages.unity.com" }, + "com.unity.toolchain.win-x86_64-linux-x86_64": { + "version": "2.0.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.sysroot": "2.0.7", + "com.unity.sysroot.linux-x86_64": "2.0.6" + }, + "url": "https://packages.unity.com" + }, "com.unity.ugui": { "version": "1.0.0", "depth": 0, diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index ad76be6..c3cc114 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -5,8 +5,14 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: - - enabled: 1 + - enabled: 0 path: Assets/Scenes/SampleScene.unity guid: 2cda990e2423bbf4892e6590ba056729 + - enabled: 1 + path: Assets/PoolSample/AddressablePools/AddressGameObjectPool_1.unity + guid: f304d0ee1f4f44064b073bf0d64062fb + - enabled: 1 + path: Assets/PoolSample/GameObjectPools/GameObjectPool.unity + guid: 022376461a79a4b7e8bbb68b56ba2d96 m_configObjects: com.unity.addressableassets: {fileID: 11400000, guid: a4ed3d350d7e25f4ea915e3071c5af7b, type: 2}