├── Editor.meta ├── Editor ├── F10.Multipool.Editor.asmdef ├── F10.Multipool.Editor.asmdef.meta ├── Icons.meta ├── Icons │ ├── MultipoolEmitterEditor_Icon64.png │ ├── MultipoolEmitterEditor_Icon64.png.meta │ ├── MultipoolEmmiter_Icon64.png │ ├── MultipoolEmmiter_Icon64.png.meta │ ├── MultipoolManagerEditor_Icon64.png │ ├── MultipoolManagerEditor_Icon64.png.meta │ ├── MultipoolManager_Icon64.png │ ├── MultipoolManager_Icon64.png.meta │ ├── MultipoolReset_Icon64.png │ └── MultipoolReset_Icon64.png.meta ├── MultipoolEmitterEditor.cs ├── MultipoolEmitterEditor.cs.meta ├── MultipoolManagerEditor.cs └── MultipoolManagerEditor.cs.meta ├── LICENSE ├── LICENSE.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── F10.Multipool.asmdef ├── F10.Multipool.asmdef.meta ├── MultipoolEmitter.cs ├── MultipoolEmitter.cs.meta ├── MultipoolManager.cs ├── MultipoolManager.cs.meta ├── MultipoolPool.cs ├── MultipoolPool.cs.meta ├── MultipoolReset.cs └── MultipoolReset.cs.meta ├── Samples~ ├── Ball Demo.meta └── Ball Demo │ ├── Materials.meta │ ├── Materials │ ├── Blue.mat │ ├── Blue.mat.meta │ ├── Green.mat │ ├── Green.mat.meta │ ├── Red.mat │ └── Red.mat.meta │ ├── MultipoolDemo.meta │ ├── MultipoolDemo.unity │ ├── MultipoolDemo.unity.meta │ ├── MultipoolDemo │ ├── LightingData.asset │ ├── LightingData.asset.meta │ ├── ReflectionProbe-0.exr │ └── ReflectionProbe-0.exr.meta │ ├── Prefabs.meta │ ├── Prefabs │ ├── Blue_Bullet.prefab │ ├── Blue_Bullet.prefab.meta │ ├── Green_Bullet.prefab │ ├── Green_Bullet.prefab.meta │ ├── Red_Bullet.prefab │ └── Red_Bullet.prefab.meta │ ├── Scripts.meta │ └── Scripts │ ├── BulletStartDemo.cs │ └── BulletStartDemo.cs.meta ├── package.json └── package.json.meta /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ba0151638ffbb2438e56bd758bec9a7 3 | folderAsset: yes 4 | timeCreated: 1477699146 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Editor/F10.Multipool.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "F10.Multipool.Editor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:8ceef2819eb8ee94eb93ba11a0c3fcff" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Editor/F10.Multipool.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8662dff7d9b05e478598db3ac4c203d 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Editor/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb92bdb2dc130064aacded5b6c0124de 3 | folderAsset: yes 4 | timeCreated: 1492233681 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Editor/Icons/MultipoolEmitterEditor_Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Editor/Icons/MultipoolEmitterEditor_Icon64.png -------------------------------------------------------------------------------- /Editor/Icons/MultipoolEmitterEditor_Icon64.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2afd78b6b2ec8b44817525c939a5bab 3 | timeCreated: 1492234167 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 2 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 64 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 64 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Editor/Icons/MultipoolEmmiter_Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Editor/Icons/MultipoolEmmiter_Icon64.png -------------------------------------------------------------------------------- /Editor/Icons/MultipoolEmmiter_Icon64.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46d23c4574ef76348baf96dd7e9d3fcc 3 | timeCreated: 1492233931 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 2 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 64 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 64 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Editor/Icons/MultipoolManagerEditor_Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Editor/Icons/MultipoolManagerEditor_Icon64.png -------------------------------------------------------------------------------- /Editor/Icons/MultipoolManagerEditor_Icon64.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e9b6b6b46f4b7247a00d4da845c0c61 3 | timeCreated: 1492234240 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 2 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 64 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 64 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Editor/Icons/MultipoolManager_Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Editor/Icons/MultipoolManager_Icon64.png -------------------------------------------------------------------------------- /Editor/Icons/MultipoolManager_Icon64.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b0bd43a99554d447a29a8b5b564c668 3 | timeCreated: 1492233828 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: 1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 2 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 64 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 64 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Editor/Icons/MultipoolReset_Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Editor/Icons/MultipoolReset_Icon64.png -------------------------------------------------------------------------------- /Editor/Icons/MultipoolReset_Icon64.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31f059655d0698e469ce7cceb368ce6b 3 | timeCreated: 1492234313 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 2 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 64 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 64 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Editor/MultipoolEmitterEditor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MultipoolEmitterEditor.cs 3 | * Editor Script. Generates the popup list from ObjectPooling.generatedEnum. 4 | * 5 | * by Adam Carballo under MIT license. 6 | * https://github.com/AdamCarballo/Unity-MultiPool 7 | */ 8 | 9 | using System.Linq; 10 | using UnityEditor; 11 | 12 | namespace F10.Multipool.Editor { 13 | [CustomEditor(typeof(MultipoolEmitter))] 14 | public class MultipoolEmitterEditor : UnityEditor.Editor { 15 | 16 | private SerializedProperty _index; // int 17 | 18 | /// 19 | /// Set MultipoolEmitter and configure the popup index. 20 | /// 21 | private void OnEnable() { 22 | serializedObject.Update(); 23 | 24 | _index = serializedObject.FindProperty("_index"); 25 | } 26 | 27 | /// 28 | /// Draw the popup on the inspector and save a copy locally. 29 | /// 30 | public override void OnInspectorGUI() { 31 | serializedObject.Update(); 32 | 33 | EditorGUILayout.HelpBox( 34 | "Remember to index the object pools to make them appear on the Emitter list.", 35 | MessageType.Info 36 | ); 37 | 38 | var poolNames = MultipoolManagerEditor.PoolNames.ToArray(); 39 | _index.intValue = EditorGUILayout.Popup("Selected Pool", _index.intValue, poolNames); 40 | 41 | serializedObject.ApplyModifiedProperties(); 42 | } 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /Editor/MultipoolEmitterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc928df0a13f61649b6aafa5e5880a59 3 | timeCreated: 1492234202 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: e2afd78b6b2ec8b44817525c939a5bab, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Editor/MultipoolManagerEditor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MultipoolEditor.cs 3 | * Editor Script. Draws Button and HelpBox on the inspector. 4 | * 5 | * by Adam Carballo under MIT license. 6 | * https://github.com/AdamCarballo/Unity-MultiPool 7 | */ 8 | 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Text; 12 | using UnityEditor; 13 | using UnityEngine; 14 | 15 | namespace F10.Multipool.Editor { 16 | [CustomEditor(typeof(MultipoolManager))] 17 | public class MultipoolManagerEditor : UnityEditor.Editor { 18 | 19 | private const string PoolNamePrefName = "Multipool_PoolNames"; 20 | 21 | private static List poolNames = null; 22 | 23 | public static IEnumerable PoolNames { 24 | get { 25 | if (poolNames == null) { 26 | GenerateEmitterEnum(); 27 | } 28 | 29 | return poolNames; 30 | } 31 | } 32 | 33 | private static readonly string[] _excludeList = {"m_Script"}; 34 | 35 | private MultipoolManager _multipool; 36 | 37 | private GUIStyle _runtimeHelpBoxStyle = null; 38 | 39 | private GUIStyle RuntimeHelpBoxStyle => 40 | _runtimeHelpBoxStyle ??= new GUIStyle(GUI.skin.GetStyle("HelpBox")) { 41 | richText = true, 42 | alignment = TextAnchor.UpperCenter, 43 | contentOffset = new Vector2(0, 3) 44 | }; 45 | 46 | private GUIStyle _runtimeHelpBoxPlayingStyle = null; 47 | 48 | private GUIStyle RuntimeHelpBoxPlayingStyle => 49 | _runtimeHelpBoxPlayingStyle ??= new GUIStyle(_runtimeHelpBoxStyle) { 50 | richText = true, 51 | alignment = TextAnchor.UpperLeft, 52 | contentOffset = new Vector2(10, 8) 53 | }; 54 | 55 | /// 56 | /// Set the script reference. 57 | /// 58 | private void OnEnable() { 59 | _multipool = (MultipoolManager) target; 60 | } 61 | 62 | /// 63 | /// Draw a Button with a call action to GenerateEnum(), draw a HelpBox and hide the MonoBehaviour script. 64 | /// 65 | public override void OnInspectorGUI() { 66 | EditorGUILayout.TextArea( 67 | "MultiPool v1.3\n" + 68 | "https://github.com/AdamCarballo/Unity-MultiPool\n" 69 | , RuntimeHelpBoxStyle); 70 | 71 | if (Application.isPlaying) { 72 | EditorGUILayout.TextArea( 73 | $"Runtime Stats\n\n{GetRuntimeInformation()}", 74 | RuntimeHelpBoxPlayingStyle); 75 | } else { 76 | EditorGUILayout.HelpBox( 77 | "Remember to index the object pools to make them appear on the Emitter list.", 78 | MessageType.Info 79 | ); 80 | if (GUILayout.Button("Index Object Pools")) { 81 | SaveEmitterEnum(); 82 | GenerateEmitterEnum(); 83 | } 84 | } 85 | 86 | EditorGUILayout.Space(); 87 | 88 | serializedObject.Update(); 89 | DrawPropertiesExcluding(serializedObject, _excludeList); 90 | serializedObject.ApplyModifiedProperties(); 91 | 92 | EditorUtility.SetDirty(target); 93 | } 94 | 95 | /// 96 | /// Returns current pool information, including active objects and objects created during runtime. 97 | /// 98 | /// Formatted string. 99 | private string GetRuntimeInformation() { 100 | var info = new StringBuilder(); 101 | var allPools = _multipool.AllPools; 102 | 103 | foreach (var pool in allPools) { 104 | var activeAmount = pool.ActiveObjectAmount; 105 | var color = GetStatColor(pool, activeAmount); 106 | var extraAmount = pool.CurrentSize - pool.StartAmount; 107 | 108 | info.AppendLine($"{pool.Name} " + 109 | $"({activeAmount}/{pool.CurrentSize}) " + 110 | $"+ [{extraAmount}]"); 111 | } 112 | 113 | return info.ToString(); 114 | } 115 | 116 | /// 117 | /// Calculate the pool name color on the editor based on the current usage. 118 | /// 119 | /// Pool to check. 120 | /// Objects active from the pool. 121 | /// String with color name 122 | private static string GetStatColor(MultipoolPool pool, int activeObj) { 123 | float percentage = (float) activeObj / pool.CurrentSize; 124 | 125 | if (percentage < 0.75f) { 126 | return "green"; 127 | } 128 | 129 | if (percentage < 0.95f) { 130 | return "orange"; 131 | } 132 | 133 | if (pool.CanGrow) { 134 | return "maroon"; 135 | } 136 | 137 | return "red"; 138 | } 139 | 140 | private void SaveEmitterEnum() { 141 | var poolNamesFormatted = string.Join(",", _multipool.AllPools.Select(pool => pool.Name)); 142 | EditorPrefs.SetString(PoolNamePrefName, poolNamesFormatted); 143 | } 144 | 145 | /// 146 | /// Generates a list of all the object pools names to be shown on an emitter's enum. 147 | /// 148 | private static void GenerateEmitterEnum() { 149 | poolNames = new List(); 150 | 151 | // Load saved names for editor config 152 | var savedPoolNames = EditorPrefs.GetString(PoolNamePrefName); 153 | if (string.IsNullOrEmpty(savedPoolNames)) { 154 | // If no data is saved, try to find the manager in the scene 155 | var multipool = FindObjectOfType(); 156 | if (multipool == null) { 157 | Debug.LogWarning("[MultiPool] Couldn't find any MultiPool data! Please re-index the pools."); 158 | return; 159 | } 160 | 161 | foreach (var pool in multipool.AllPools) { 162 | poolNames.Add(pool.Name); 163 | } 164 | } else { 165 | poolNames = savedPoolNames.Split(',').ToList(); 166 | } 167 | } 168 | 169 | } 170 | } -------------------------------------------------------------------------------- /Editor/MultipoolManagerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6de03e42ddee046458f281786db15391 3 | timeCreated: 1492234266 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 3e9b6b6b46f4b7247a00d4da845c0c61, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Àdam Carballo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a6c01e12e03c314989a08104eecd2ba 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Unity MultiPool 2 | ================= 3 | 🗄 MultiPool - Expandable Object Pooling for Unity 4 | 5 | Overview 6 | ---- 7 | Using object pooling to replace `Instantiate()` and `Destroy()` can help the CPU on games with multiple instances of the same object, like *bullet hell* games or *shooters*. It also helps enormously on mobile platforms with reduced CPU capabilities. 8 | 9 | Object pools will trade a little of memory footprint for a lower CPU usage. This is crucial for maintaining consistent framerates. 10 | 11 | This Object Pooling solution can be used for multiple objects and pools without the need of duplicating scripts or GameObjects. 12 | 13 | Install 14 | ---- 15 | The source code is available directly from the repository.
16 | Though, it's recommended to add this code as a **Unity Package**, as it contains all required configurations. 17 | 18 | The original version of MultiPool (anything under v2) will work with any version of Unity 5. Newer versions (v2 and higher) haven't been tested in any version lower than Unity 2019. 19 | 20 | Usage 21 | ---- 22 | Object Polling consists of two main scripts, `MultipoolManager.cs`and `MultipoolEmitter.cs`.
23 | Though, there are other optional scripts, like `MultipoolReset.cs` that allow quick setups for simple deployments. 24 | 25 | All scripts include the *`F10.Multipool`* namespace to avoid issues with existing scripts. Remember to use it. 26 | 27 | Add `MultipoolManager` to any GameObject to start using pools. 28 | 29 | #### MultipoolManager.cs 30 | Holds all the current object pools and handles internal calls for new objects.
31 | At `Start()` all the object pools will generate the amount of desired objects ready to be called. 32 | 33 | During runtime will display relevant information of how your object pools are performing. 34 | 35 | ![MultiPool Runtime Inspector](https://i.imgur.com/x07ei9n.png) 36 | ___ 37 | 38 | #### MultipoolEmitter.cs 39 | Receives the amount of object pools available and displays them on a popup in the Inspector.
40 | Use this script to call an specific pool from the list of available pools using `Generate()`. 41 | ___ 42 | 43 | ### Creating Object Pools: 44 | Change the size of `MultipoolManager._pools[]`in the inspector to generate more or less object pools. 45 | 46 | ```csharp 47 | Name; // Name of the object pool. Will appear on the generated popup. 48 | ObjectReference; // Object to pool. 49 | StartAmount; // Number of objects that will be generated on Start(). 50 | CanGrow; // If true, the pool will generate more items than startAmount if needed. 51 | MaxGrow; // Limit of pool grow. 0 = unlimited. 52 | CustomParent; // Optional. Sets the object inside a parent for a cleaner Hierarchy. 53 | DisableIfGameObject; // Disable the available objects after generation if they are GameObjects. 54 | ``` 55 | 56 | After finishing editing the pools, remember to press **Index Object Pools** button to display them correctly. 57 | 58 | ### Extracting objects from Object Pools: 59 | Define the pool to be used with the `MultipoolEmitter` popup in the inspector.
60 | Keep in mind that you first need to **Index Object Pools** if the popup appears empty. 61 | 62 | Using `MultipoolEmitter.Generate()` will return an object from the desired pool.
63 | `Generate()`can also return `null` if the pool is empty and `CanGrow` is set to false, or `MaxGrow` has reached the limit. 64 | 65 | Example using `BulletStartDemo.cs`: 66 | 67 | ```csharp 68 | [Range(0.1f, 2f)] 69 | [SerializeField] 70 | private float _fireTime; 71 | private MultipoolEmitter _emitter; 72 | 73 | /// 74 | /// Reference the Emitter. 75 | /// 76 | private void Awake() { 77 | _emitter = GetComponent(); 78 | } 79 | 80 | /// 81 | /// Start generating each fireTime. 82 | /// 83 | private void Start() { 84 | StartCoroutine(SpawnNew()); 85 | } 86 | 87 | /// 88 | /// Retrieve from the object pool, check if null, reset position, rotation and set active. 89 | /// 90 | private IEnumerator SpawnNew() { 91 | while (true) { 92 | var obj = _emitter.GenerateGameObject(); 93 | 94 | if (obj != null) { 95 | var thisTransform = transform; 96 | obj.transform.position = thisTransform.position; 97 | obj.transform.rotation = thisTransform.rotation; 98 | } 99 | 100 | yield return new WaitForSeconds(_fireTime); 101 | } 102 | } 103 | ``` 104 | 105 | If using the `MultipoolEmitter` is not a good idea in your case (for example, you need multiple objects from different pools in one script), you can access `MultipoolManager` directly using the singleton instance `MultipoolManager.Instance`.
106 | To get an object from a pool, use the function `MultipoolManager.GetPooledObject(int index)` where `index` is the id of the list (position on the inspector).
107 | There is also `MultipoolManager.GetPooledObject(string poolName)` where `poolName` is the name of the pool, although this method is more performance intensive. 108 | 109 | 110 | Feel free to inspect all functions inside `MultipoolManager` to make it work with your code. 111 | 112 | ### Returning objects to Object Pools: 113 | The source already includes `MultipoolReset.cs` as an example.
114 | The only requirement is to call `MultipoolEmitter.Return()` (when using the provided emitter), or `MultipoolManager.ReturnPooledObject(T obj, int index / string poolName)` to return an object to the pool. 115 | 116 | If you use the object on other lists or arrays, remember to also remove it.
117 | It's also recommended to reset `Rigidbody.velocity`if the object uses physics. 118 | 119 | Demo 120 | ---- 121 | The `Samples~` folder in the source code (included in the Unity Package as a sample) includes a demo scene to understand how everything works. 122 | 123 | History 124 | ---- 125 | Created by Àdam Carballo
126 | Check other works on *[F10.DEV](https://f10.dev)* 127 | 128 | License 129 | --- 130 | MIT License
131 | Script icons by [Game-Icons.net](https://game-icons.net/) 132 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68f2f0b27bb0e904ea5dfb0c573ff2fb 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 093fe50dcfb8ef04ba9e14be41fd668a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/F10.Multipool.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "F10.Multipool" 3 | } 4 | -------------------------------------------------------------------------------- /Runtime/F10.Multipool.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ceef2819eb8ee94eb93ba11a0c3fcff 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/MultipoolEmitter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MultipoolEmitter.cs 3 | * Emitter Configurator. Extract objects with MultipoolEmitter.Generate(); 4 | * 5 | * This emitter has a helper class that supports GameObjects by default, and works best with a MultipoolReset attached to the pooled objects. 6 | * This script is not required to interact with the MultipoolManager, but the custom inspector may be useful when configuring multiple pools. 7 | * 8 | * by Adam Carballo under MIT license. 9 | * https://github.com/AdamCarballo/Unity-MultiPool 10 | */ 11 | 12 | using UnityEngine; 13 | using JetBrains.Annotations; 14 | 15 | namespace F10.Multipool { 16 | public class MultipoolEmitter : MonoBehaviour { 17 | 18 | [HideInInspector] 19 | public int _index; 20 | 21 | /// 22 | /// Retrieve from the index GameObject pool, check if null, and return the object already activated to the caller. 23 | /// 24 | /// Pooled GameObject or null. 25 | [CanBeNull] 26 | public GameObject GenerateGameObject() { 27 | var obj = MultipoolManager.Instance.GetPooledObject(_index); 28 | if (obj == null) return null; 29 | 30 | var reset = obj.GetComponent(); 31 | if (reset != null) { 32 | reset.Emitter = this; 33 | } 34 | 35 | obj.SetActive(true); 36 | return obj; 37 | } 38 | 39 | /// 40 | /// Retrieve from the index object pool, check if null, and return the object already activated to the caller. 41 | ///
42 | /// This method does not support MultipoolReset by default. 43 | ///
44 | /// Pooled object or null. 45 | [CanBeNull] 46 | public T Generate() where T : Object { 47 | return MultipoolManager.Instance.GetPooledObject(_index); 48 | } 49 | 50 | /// 51 | /// Disable the passed GameObject and send it back into the pool. 52 | /// 53 | /// GameObject to return. 54 | public void ReturnGameObject(GameObject @object) { 55 | @object.SetActive(false); 56 | MultipoolManager.Instance.ReturnPooledObject(@object, _index); 57 | } 58 | 59 | /// 60 | /// Send the passed object back into the pool. 61 | /// 62 | /// Object to return. 63 | public void Return(T @object) where T : Object { 64 | MultipoolManager.Instance.ReturnPooledObject(@object, _index); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /Runtime/MultipoolEmitter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 309382c06730cc74ea23dea13141b45b 3 | timeCreated: 1492233968 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 46d23c4574ef76348baf96dd7e9d3fcc, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Runtime/MultipoolManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Multipool.cs 3 | * Manage the pooling of any object and calls to retrieve them. 4 | * 5 | * by Adam Carballo under MIT license. 6 | * https://github.com/AdamCarballo/Unity-MultiPool 7 | */ 8 | 9 | using System; 10 | using UnityEngine; 11 | using System.Collections.Generic; 12 | using JetBrains.Annotations; 13 | using Object = UnityEngine.Object; 14 | 15 | namespace F10.Multipool { 16 | [HelpURL("https://github.com/AdamCarballo/Unity-MultiPool")] 17 | [DefaultExecutionOrder(-100)] 18 | public class MultipoolManager : MonoBehaviour { 19 | 20 | public static MultipoolManager Instance { get; private set; } = null; 21 | 22 | [SerializeField] 23 | private MultipoolPool[] _pools; 24 | 25 | public IEnumerable AllPools => _pools; 26 | 27 | /// 28 | /// Define instance and check for duplicated pools. 29 | /// 30 | private void Awake() { 31 | if (Instance != null) { 32 | Debug.LogError("[MultiPool] MultiPool can only exist once in the scene!"); 33 | #if UNITY_EDITOR 34 | UnityEditor.EditorApplication.isPaused = true; 35 | #endif 36 | } 37 | 38 | Instance = this; 39 | } 40 | 41 | /// 42 | /// Instantiate the startAmount of poolObject and deactivate them. 43 | /// 44 | private void Start() { 45 | foreach (var pool in _pools) { 46 | pool.StartPool(); 47 | } 48 | } 49 | 50 | /// 51 | /// Returns an available object. If there isn't one, and canGrow, will create a new one. 52 | ///
53 | /// It is recommended to use an emitter or use the overload of GetPooledObject() that uses a pools index for better performance. 54 | ///
55 | /// Name of the pool. 56 | /// Available object marked as active, or null if the pool is empty. 57 | [CanBeNull] 58 | public T GetPooledObject(string poolName) where T : Object { 59 | for (int i = 0; i < _pools.Length; i++) { 60 | if (_pools[i].Name == poolName) { 61 | return GetPooledObject(i); 62 | } 63 | } 64 | 65 | throw new ArgumentException($"[MultiPool] There is no pool with the name {poolName}"); 66 | } 67 | 68 | /// 69 | /// Returns an available object. If there isn't one, and canGrow, will create a new one. 70 | /// 71 | /// Index of the pool. 72 | /// Available object marked as active, or null if the pool is empty. 73 | [CanBeNull] 74 | public T GetPooledObject(int index) where T : Object { 75 | var pool = _pools[index]; 76 | return pool.GetPooledObject() as T; 77 | } 78 | 79 | /// 80 | /// Marks the passed object as available to the pool to be re-used. 81 | /// 82 | /// Name of the pool. 83 | /// Object to return. 84 | public void ReturnPooledObject(T obj, string poolName) where T : Object { 85 | for (int i = 0; i < _pools.Length; i++) { 86 | if (_pools[i].Name == poolName) { 87 | ReturnPooledObject(obj, i); 88 | } 89 | } 90 | 91 | throw new ArgumentException($"[MultiPool] There is no pool with the name {poolName}"); 92 | } 93 | 94 | /// 95 | /// Marks the passed object as available to the pool to be re-used. 96 | /// 97 | /// Index of the pool. 98 | /// Object to return. 99 | public void ReturnPooledObject(T obj, int index) where T : Object { 100 | var pool = _pools[index]; 101 | pool.ReturnPooledObject(obj.GetInstanceID()); 102 | } 103 | 104 | } 105 | } -------------------------------------------------------------------------------- /Runtime/MultipoolManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d7f04dff4ef2da4595c21655fb1b01a 3 | timeCreated: 1492233847 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 4b0bd43a99554d447a29a8b5b564c668, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Runtime/MultipoolPool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using UnityEngine; 5 | using Object = UnityEngine.Object; 6 | 7 | namespace F10.Multipool { 8 | [Serializable] 9 | public class MultipoolPool { 10 | 11 | [Tooltip("Name of this pool as it will appear on the dropdown of the emitters.")] 12 | [SerializeField] 13 | private string _name; 14 | 15 | public string Name => _name; 16 | 17 | [Tooltip("Object to be pooled.")] 18 | [SerializeField] 19 | private Object _objectReference; 20 | 21 | [Tooltip("How many objects will get pre-spawned before the scene starts (pool size).")] 22 | [SerializeField] 23 | private int _startAmount; 24 | 25 | public int StartAmount => _startAmount; 26 | 27 | [Tooltip("Can this pool grow if the requested items are higher than the start amount.")] 28 | [SerializeField] 29 | private bool _canGrow = true; 30 | 31 | public bool CanGrow { 32 | get => _canGrow; 33 | set => _canGrow = value; 34 | } 35 | 36 | [Tooltip("Limit of pool grow. 0 = unlimited.")] 37 | [SerializeField] 38 | private int _maxGrow = 0; 39 | 40 | public int MaxGrow { 41 | get => _maxGrow; 42 | set => _maxGrow = value; 43 | } 44 | 45 | [Tooltip("Will this pool spawn objects inside a custom parent, or use the default one.")] 46 | [SerializeField] 47 | private Transform _customParent; 48 | 49 | public Transform CustomParent { 50 | get => _customParent; 51 | set => _customParent = value; 52 | } 53 | 54 | [Tooltip("Disable the available objects after generation if they are GameObjects.")] 55 | [SerializeField] 56 | private bool _disableIfGameObject = true; 57 | 58 | private Stack _availableObjects = null; 59 | private Dictionary _activeObjects = null; 60 | 61 | /// 62 | /// Amount of active (in use) objects. 63 | ///
64 | /// This method will allocate garbage each time is called. Use carefully. 65 | ///
66 | public int ActiveObjectAmount => _activeObjects.Count; 67 | 68 | /// 69 | /// Current size of the pool, regardless of startAmount. 70 | /// 71 | public int CurrentSize => _availableObjects.Count + _activeObjects.Count; 72 | 73 | /// 74 | /// Start and generate all the objects defined by startAmount. 75 | /// 76 | /// Instantiated object. 77 | public void StartPool() { 78 | _availableObjects = new Stack(_startAmount); 79 | _activeObjects = new Dictionary(_startAmount); 80 | 81 | for (int i = 0; i < _startAmount; i++) { 82 | GenerateObjectInPool(); 83 | } 84 | } 85 | 86 | /// 87 | /// Instantiate an object inside the pool to be used later. 88 | /// 89 | /// Instantiated object. 90 | public void GenerateObjectInPool() { 91 | var obj = Object.Instantiate(_objectReference); 92 | 93 | if (_disableIfGameObject && obj is GameObject gameObj) { 94 | gameObj.SetActive(false); 95 | 96 | if (_customParent != null) { 97 | gameObj.transform.SetParent(_customParent, true); 98 | } 99 | } 100 | 101 | _availableObjects.Push(obj); 102 | } 103 | 104 | /// 105 | /// Returns an available object. If there isn't one, and canGrow, will create a new one. 106 | /// 107 | /// Available object marked as active. 108 | [CanBeNull] 109 | public Object GetPooledObject() { 110 | if (_availableObjects.Count == 0) { 111 | if (!_canGrow) return null; 112 | 113 | if (_maxGrow == 0 || CurrentSize < (_maxGrow + _startAmount)) { 114 | GenerateObjectInPool(); 115 | } else { 116 | return null; 117 | } 118 | } 119 | 120 | var obj = _availableObjects.Pop(); 121 | _activeObjects.Add(obj.GetInstanceID(), obj); 122 | 123 | return obj; 124 | } 125 | 126 | /// 127 | /// Marks the passed object as available to the pool to be re-used. 128 | /// 129 | /// Object's instance ID to return to the pool. 130 | /// Available object marked as active. 131 | [CanBeNull] 132 | public void ReturnPooledObject(int objInstanceId) { 133 | if (!_activeObjects.ContainsKey(objInstanceId)) { 134 | #if UNITY_EDITOR 135 | throw new ArgumentException($"[MultiPool] The pool {_name} is not the owner of {UnityEditor.EditorUtility.InstanceIDToObject(objInstanceId).name}"); 136 | #else 137 | throw new ArgumentException($"[MultiPool] The pool {_name} is not the owner of an object with ID {objInstanceId}"); 138 | #endif 139 | } 140 | 141 | var obj = _activeObjects[objInstanceId]; 142 | _activeObjects.Remove(objInstanceId); 143 | 144 | _availableObjects.Push(obj); 145 | } 146 | 147 | } 148 | } -------------------------------------------------------------------------------- /Runtime/MultipoolPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b010353955390954a9da758f66400152 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/MultipoolReset.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MultipoolReset.cs 3 | * Demo Script. Deactivates himself after the specified time. 4 | * 5 | * This script is optional. Just remember to deactivate objects to make them available again. 6 | * Also, if your object uses physics, remember to reset the velocity of the rigidbody. 7 | * 8 | * by Adam Carballo under MIT license. 9 | * https://github.com/AdamCarballo/Unity-MultiPool 10 | */ 11 | 12 | using UnityEngine; 13 | 14 | namespace F10.Multipool { 15 | public class MultipoolReset : MonoBehaviour { 16 | 17 | [SerializeField] 18 | private float _time; 19 | 20 | [SerializeField] 21 | private bool _resetRigidbody; 22 | 23 | public MultipoolEmitter Emitter { get; set; } 24 | 25 | /// 26 | /// Execute Return function after time. 27 | /// 28 | private void OnEnable() { 29 | 30 | if (_resetRigidbody) { 31 | var rigidBody = GetComponent(); 32 | rigidBody.velocity = Vector3.zero; 33 | rigidBody.angularVelocity = Vector3.zero; 34 | } 35 | 36 | Invoke(nameof(Return), _time); 37 | } 38 | 39 | /// 40 | /// Avoid multiple activations by canceling the Return() invoke. 41 | /// 42 | private void OnDisable() { 43 | CancelInvoke(); 44 | } 45 | 46 | /// 47 | /// Deactivate current GameObject. 48 | /// 49 | private void Return() { 50 | if (Emitter == null) { 51 | Debug.LogError("[MultiPool] MultipoolReset must be used in conjunction with a MultipoolEmitter."); 52 | return; 53 | } 54 | 55 | Emitter.ReturnGameObject(gameObject); 56 | } 57 | 58 | } 59 | } -------------------------------------------------------------------------------- /Runtime/MultipoolReset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f61570c47e611a548aa499eedc3c0843 3 | timeCreated: 1492234340 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 31f059655d0698e469ce7cceb368ce6b, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Samples~/Ball Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d59754befa697c944a88a995d7f8978e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3709762c6f16a847b9a640e15413f10 3 | folderAsset: yes 4 | timeCreated: 1477699146 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials/Blue.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Blue 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0.13103437, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2987f78fa0fbe934ab29e69416bea49b 3 | timeCreated: 1477699147 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials/Green.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Green 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 1, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials/Green.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8db5ac0e6aacbe24f93fe7179ba16f69 3 | timeCreated: 1477699147 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials/Red.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Red 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Materials/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 734d12a8442bf0b409d5c6a05a39a34f 3 | timeCreated: 1477699147 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27e7e9f007bf70b4d84d18160e927b81 3 | folderAsset: yes 4 | timeCreated: 1492236090 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 1716710054} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 0 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 1024 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 1 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 112000010, guid: 3ffb72967ebbe544396fd5483c5dabcf, 101 | type: 2} 102 | m_LightingSettings: {fileID: 430581919} 103 | --- !u!196 &4 104 | NavMeshSettings: 105 | serializedVersion: 2 106 | m_ObjectHideFlags: 0 107 | m_BuildSettings: 108 | serializedVersion: 2 109 | agentTypeID: 0 110 | agentRadius: 0.5 111 | agentHeight: 2 112 | agentSlope: 45 113 | agentClimb: 0.4 114 | ledgeDropHeight: 0 115 | maxJumpAcrossDistance: 0 116 | minRegionArea: 2 117 | manualCellSize: 0 118 | cellSize: 0.16666667 119 | manualTileSize: 0 120 | tileSize: 256 121 | accuratePlacement: 0 122 | maxJobWorkers: 0 123 | preserveTilesOutsideBounds: 0 124 | debug: 125 | m_Flags: 0 126 | m_NavMeshData: {fileID: 0} 127 | --- !u!850595691 &430581919 128 | LightingSettings: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | m_Name: Settings.lighting 134 | serializedVersion: 3 135 | m_GIWorkflowMode: 1 136 | m_EnableBakedLightmaps: 0 137 | m_EnableRealtimeLightmaps: 1 138 | m_RealtimeEnvironmentLighting: 1 139 | m_BounceScale: 1 140 | m_AlbedoBoost: 1 141 | m_IndirectOutputScale: 1 142 | m_UsingShadowmask: 0 143 | m_BakeBackend: 0 144 | m_LightmapMaxSize: 1024 145 | m_BakeResolution: 40 146 | m_Padding: 2 147 | m_TextureCompression: 1 148 | m_AO: 0 149 | m_AOMaxDistance: 1 150 | m_CompAOExponent: 0 151 | m_CompAOExponentDirect: 0 152 | m_ExtractAO: 0 153 | m_MixedBakeMode: 1 154 | m_LightmapsBakeMode: 1 155 | m_FilterMode: 1 156 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 157 | m_ExportTrainingData: 0 158 | m_TrainingDataDestination: TrainingData 159 | m_RealtimeResolution: 2 160 | m_ForceWhiteAlbedo: 0 161 | m_ForceUpdates: 0 162 | m_FinalGather: 0 163 | m_FinalGatherRayCount: 1024 164 | m_FinalGatherFiltering: 1 165 | m_PVRCulling: 1 166 | m_PVRSampling: 1 167 | m_PVRDirectSampleCount: 32 168 | m_PVRSampleCount: 500 169 | m_PVREnvironmentSampleCount: 500 170 | m_PVREnvironmentReferencePointCount: 2048 171 | m_LightProbeSampleCountMultiplier: 4 172 | m_PVRBounces: 2 173 | m_PVRMinBounces: 2 174 | m_PVREnvironmentMIS: 0 175 | m_PVRFilteringMode: 2 176 | m_PVRDenoiserTypeDirect: 0 177 | m_PVRDenoiserTypeIndirect: 0 178 | m_PVRDenoiserTypeAO: 0 179 | m_PVRFilterTypeDirect: 0 180 | m_PVRFilterTypeIndirect: 0 181 | m_PVRFilterTypeAO: 0 182 | m_PVRFilteringGaussRadiusDirect: 1 183 | m_PVRFilteringGaussRadiusIndirect: 5 184 | m_PVRFilteringGaussRadiusAO: 2 185 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 186 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 187 | m_PVRFilteringAtrousPositionSigmaAO: 1 188 | --- !u!1 &1053708259 189 | GameObject: 190 | m_ObjectHideFlags: 0 191 | m_CorrespondingSourceObject: {fileID: 0} 192 | m_PrefabInstance: {fileID: 0} 193 | m_PrefabAsset: {fileID: 0} 194 | serializedVersion: 6 195 | m_Component: 196 | - component: {fileID: 1053708260} 197 | - component: {fileID: 1053708263} 198 | - component: {fileID: 1053708262} 199 | - component: {fileID: 1053708261} 200 | m_Layer: 0 201 | m_Name: Plane 202 | m_TagString: Untagged 203 | m_Icon: {fileID: 0} 204 | m_NavMeshLayer: 0 205 | m_StaticEditorFlags: 4294967295 206 | m_IsActive: 1 207 | --- !u!4 &1053708260 208 | Transform: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInstance: {fileID: 0} 212 | m_PrefabAsset: {fileID: 0} 213 | m_GameObject: {fileID: 1053708259} 214 | m_LocalRotation: {x: 0, y: 0, z: 0.16867796, w: 0.9856713} 215 | m_LocalPosition: {x: 2.56, y: -0.93, z: 0} 216 | m_LocalScale: {x: 1, y: 1, z: 1} 217 | m_Children: [] 218 | m_Father: {fileID: 1796508633} 219 | m_RootOrder: 2 220 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 19.4219} 221 | --- !u!23 &1053708261 222 | MeshRenderer: 223 | m_ObjectHideFlags: 0 224 | m_CorrespondingSourceObject: {fileID: 0} 225 | m_PrefabInstance: {fileID: 0} 226 | m_PrefabAsset: {fileID: 0} 227 | m_GameObject: {fileID: 1053708259} 228 | m_Enabled: 1 229 | m_CastShadows: 1 230 | m_ReceiveShadows: 1 231 | m_DynamicOccludee: 1 232 | m_MotionVectors: 1 233 | m_LightProbeUsage: 1 234 | m_ReflectionProbeUsage: 1 235 | m_RayTracingMode: 2 236 | m_RayTraceProcedural: 0 237 | m_RenderingLayerMask: 1 238 | m_RendererPriority: 0 239 | m_Materials: 240 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 241 | m_StaticBatchInfo: 242 | firstSubMesh: 0 243 | subMeshCount: 0 244 | m_StaticBatchRoot: {fileID: 0} 245 | m_ProbeAnchor: {fileID: 0} 246 | m_LightProbeVolumeOverride: {fileID: 0} 247 | m_ScaleInLightmap: 1 248 | m_ReceiveGI: 1 249 | m_PreserveUVs: 1 250 | m_IgnoreNormalsForChartDetection: 0 251 | m_ImportantGI: 0 252 | m_StitchLightmapSeams: 1 253 | m_SelectedEditorRenderState: 3 254 | m_MinimumChartSize: 4 255 | m_AutoUVMaxDistance: 0.5 256 | m_AutoUVMaxAngle: 89 257 | m_LightmapParameters: {fileID: 0} 258 | m_SortingLayerID: 0 259 | m_SortingLayer: 0 260 | m_SortingOrder: 0 261 | m_AdditionalVertexStreams: {fileID: 0} 262 | --- !u!64 &1053708262 263 | MeshCollider: 264 | m_ObjectHideFlags: 0 265 | m_CorrespondingSourceObject: {fileID: 0} 266 | m_PrefabInstance: {fileID: 0} 267 | m_PrefabAsset: {fileID: 0} 268 | m_GameObject: {fileID: 1053708259} 269 | m_Material: {fileID: 0} 270 | m_IsTrigger: 0 271 | m_Enabled: 1 272 | serializedVersion: 4 273 | m_Convex: 0 274 | m_CookingOptions: 30 275 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 276 | --- !u!33 &1053708263 277 | MeshFilter: 278 | m_ObjectHideFlags: 0 279 | m_CorrespondingSourceObject: {fileID: 0} 280 | m_PrefabInstance: {fileID: 0} 281 | m_PrefabAsset: {fileID: 0} 282 | m_GameObject: {fileID: 1053708259} 283 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 284 | --- !u!1 &1340512869 285 | GameObject: 286 | m_ObjectHideFlags: 0 287 | m_CorrespondingSourceObject: {fileID: 0} 288 | m_PrefabInstance: {fileID: 0} 289 | m_PrefabAsset: {fileID: 0} 290 | serializedVersion: 6 291 | m_Component: 292 | - component: {fileID: 1340512872} 293 | - component: {fileID: 1340512871} 294 | - component: {fileID: 1340512870} 295 | m_Layer: 0 296 | m_Name: Green_Emmiter 297 | m_TagString: Untagged 298 | m_Icon: {fileID: 0} 299 | m_NavMeshLayer: 0 300 | m_StaticEditorFlags: 4294967295 301 | m_IsActive: 1 302 | --- !u!114 &1340512870 303 | MonoBehaviour: 304 | m_ObjectHideFlags: 0 305 | m_CorrespondingSourceObject: {fileID: 0} 306 | m_PrefabInstance: {fileID: 0} 307 | m_PrefabAsset: {fileID: 0} 308 | m_GameObject: {fileID: 1340512869} 309 | m_Enabled: 1 310 | m_EditorHideFlags: 0 311 | m_Script: {fileID: 11500000, guid: a7a3fc5bb03cecc449fec96a1b3ea773, type: 3} 312 | m_Name: 313 | m_EditorClassIdentifier: 314 | _fireTime: 0.4 315 | --- !u!114 &1340512871 316 | MonoBehaviour: 317 | m_ObjectHideFlags: 0 318 | m_CorrespondingSourceObject: {fileID: 0} 319 | m_PrefabInstance: {fileID: 0} 320 | m_PrefabAsset: {fileID: 0} 321 | m_GameObject: {fileID: 1340512869} 322 | m_Enabled: 1 323 | m_EditorHideFlags: 0 324 | m_Script: {fileID: 11500000, guid: 309382c06730cc74ea23dea13141b45b, type: 3} 325 | m_Name: 326 | m_EditorClassIdentifier: 327 | _index: 2 328 | --- !u!4 &1340512872 329 | Transform: 330 | m_ObjectHideFlags: 0 331 | m_CorrespondingSourceObject: {fileID: 0} 332 | m_PrefabInstance: {fileID: 0} 333 | m_PrefabAsset: {fileID: 0} 334 | m_GameObject: {fileID: 1340512869} 335 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 336 | m_LocalPosition: {x: -0.83, y: 8.93, z: 0} 337 | m_LocalScale: {x: 1, y: 1, z: 1} 338 | m_Children: [] 339 | m_Father: {fileID: 0} 340 | m_RootOrder: 3 341 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 342 | --- !u!1 &1529322167 343 | GameObject: 344 | m_ObjectHideFlags: 0 345 | m_CorrespondingSourceObject: {fileID: 0} 346 | m_PrefabInstance: {fileID: 0} 347 | m_PrefabAsset: {fileID: 0} 348 | serializedVersion: 6 349 | m_Component: 350 | - component: {fileID: 1529322169} 351 | - component: {fileID: 1529322168} 352 | - component: {fileID: 1529322170} 353 | m_Layer: 0 354 | m_Name: Red_Emitter 355 | m_TagString: Untagged 356 | m_Icon: {fileID: 0} 357 | m_NavMeshLayer: 0 358 | m_StaticEditorFlags: 4294967295 359 | m_IsActive: 1 360 | --- !u!114 &1529322168 361 | MonoBehaviour: 362 | m_ObjectHideFlags: 0 363 | m_CorrespondingSourceObject: {fileID: 0} 364 | m_PrefabInstance: {fileID: 0} 365 | m_PrefabAsset: {fileID: 0} 366 | m_GameObject: {fileID: 1529322167} 367 | m_Enabled: 1 368 | m_EditorHideFlags: 0 369 | m_Script: {fileID: 11500000, guid: 309382c06730cc74ea23dea13141b45b, type: 3} 370 | m_Name: 371 | m_EditorClassIdentifier: 372 | _index: 0 373 | --- !u!4 &1529322169 374 | Transform: 375 | m_ObjectHideFlags: 0 376 | m_CorrespondingSourceObject: {fileID: 0} 377 | m_PrefabInstance: {fileID: 0} 378 | m_PrefabAsset: {fileID: 0} 379 | m_GameObject: {fileID: 1529322167} 380 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 381 | m_LocalPosition: {x: 3.01, y: 5.69, z: 0} 382 | m_LocalScale: {x: 1, y: 1, z: 1} 383 | m_Children: [] 384 | m_Father: {fileID: 0} 385 | m_RootOrder: 1 386 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 387 | --- !u!114 &1529322170 388 | MonoBehaviour: 389 | m_ObjectHideFlags: 0 390 | m_CorrespondingSourceObject: {fileID: 0} 391 | m_PrefabInstance: {fileID: 0} 392 | m_PrefabAsset: {fileID: 0} 393 | m_GameObject: {fileID: 1529322167} 394 | m_Enabled: 1 395 | m_EditorHideFlags: 0 396 | m_Script: {fileID: 11500000, guid: a7a3fc5bb03cecc449fec96a1b3ea773, type: 3} 397 | m_Name: 398 | m_EditorClassIdentifier: 399 | _fireTime: 0.4 400 | --- !u!1 &1607543247 401 | GameObject: 402 | m_ObjectHideFlags: 0 403 | m_CorrespondingSourceObject: {fileID: 0} 404 | m_PrefabInstance: {fileID: 0} 405 | m_PrefabAsset: {fileID: 0} 406 | serializedVersion: 6 407 | m_Component: 408 | - component: {fileID: 1607543249} 409 | - component: {fileID: 1607543248} 410 | - component: {fileID: 1607543250} 411 | m_Layer: 0 412 | m_Name: Blue_Emitter 413 | m_TagString: Untagged 414 | m_Icon: {fileID: 0} 415 | m_NavMeshLayer: 0 416 | m_StaticEditorFlags: 4294967295 417 | m_IsActive: 1 418 | --- !u!114 &1607543248 419 | MonoBehaviour: 420 | m_ObjectHideFlags: 0 421 | m_CorrespondingSourceObject: {fileID: 0} 422 | m_PrefabInstance: {fileID: 0} 423 | m_PrefabAsset: {fileID: 0} 424 | m_GameObject: {fileID: 1607543247} 425 | m_Enabled: 1 426 | m_EditorHideFlags: 0 427 | m_Script: {fileID: 11500000, guid: 309382c06730cc74ea23dea13141b45b, type: 3} 428 | m_Name: 429 | m_EditorClassIdentifier: 430 | _index: 1 431 | --- !u!4 &1607543249 432 | Transform: 433 | m_ObjectHideFlags: 0 434 | m_CorrespondingSourceObject: {fileID: 0} 435 | m_PrefabInstance: {fileID: 0} 436 | m_PrefabAsset: {fileID: 0} 437 | m_GameObject: {fileID: 1607543247} 438 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 439 | m_LocalPosition: {x: -6.34, y: 3.21, z: 0} 440 | m_LocalScale: {x: 1, y: 1, z: 1} 441 | m_Children: [] 442 | m_Father: {fileID: 0} 443 | m_RootOrder: 2 444 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 445 | --- !u!114 &1607543250 446 | MonoBehaviour: 447 | m_ObjectHideFlags: 0 448 | m_CorrespondingSourceObject: {fileID: 0} 449 | m_PrefabInstance: {fileID: 0} 450 | m_PrefabAsset: {fileID: 0} 451 | m_GameObject: {fileID: 1607543247} 452 | m_Enabled: 1 453 | m_EditorHideFlags: 0 454 | m_Script: {fileID: 11500000, guid: a7a3fc5bb03cecc449fec96a1b3ea773, type: 3} 455 | m_Name: 456 | m_EditorClassIdentifier: 457 | _fireTime: 0.4 458 | --- !u!1 &1648765062 459 | GameObject: 460 | m_ObjectHideFlags: 0 461 | m_CorrespondingSourceObject: {fileID: 0} 462 | m_PrefabInstance: {fileID: 0} 463 | m_PrefabAsset: {fileID: 0} 464 | serializedVersion: 6 465 | m_Component: 466 | - component: {fileID: 1648765063} 467 | - component: {fileID: 1648765066} 468 | - component: {fileID: 1648765065} 469 | - component: {fileID: 1648765064} 470 | m_Layer: 0 471 | m_Name: Plane (1) 472 | m_TagString: Untagged 473 | m_Icon: {fileID: 0} 474 | m_NavMeshLayer: 0 475 | m_StaticEditorFlags: 4294967295 476 | m_IsActive: 1 477 | --- !u!4 &1648765063 478 | Transform: 479 | m_ObjectHideFlags: 0 480 | m_CorrespondingSourceObject: {fileID: 0} 481 | m_PrefabInstance: {fileID: 0} 482 | m_PrefabAsset: {fileID: 0} 483 | m_GameObject: {fileID: 1648765062} 484 | m_LocalRotation: {x: 0, y: 0, z: -0.18056476, w: 0.9835631} 485 | m_LocalPosition: {x: -4.28, y: -6.3, z: 0} 486 | m_LocalScale: {x: 1, y: 1, z: 1} 487 | m_Children: [] 488 | m_Father: {fileID: 1796508633} 489 | m_RootOrder: 3 490 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: -20.8053} 491 | --- !u!23 &1648765064 492 | MeshRenderer: 493 | m_ObjectHideFlags: 0 494 | m_CorrespondingSourceObject: {fileID: 0} 495 | m_PrefabInstance: {fileID: 0} 496 | m_PrefabAsset: {fileID: 0} 497 | m_GameObject: {fileID: 1648765062} 498 | m_Enabled: 1 499 | m_CastShadows: 1 500 | m_ReceiveShadows: 1 501 | m_DynamicOccludee: 1 502 | m_MotionVectors: 1 503 | m_LightProbeUsage: 1 504 | m_ReflectionProbeUsage: 1 505 | m_RayTracingMode: 2 506 | m_RayTraceProcedural: 0 507 | m_RenderingLayerMask: 1 508 | m_RendererPriority: 0 509 | m_Materials: 510 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 511 | m_StaticBatchInfo: 512 | firstSubMesh: 0 513 | subMeshCount: 0 514 | m_StaticBatchRoot: {fileID: 0} 515 | m_ProbeAnchor: {fileID: 0} 516 | m_LightProbeVolumeOverride: {fileID: 0} 517 | m_ScaleInLightmap: 1 518 | m_ReceiveGI: 1 519 | m_PreserveUVs: 1 520 | m_IgnoreNormalsForChartDetection: 0 521 | m_ImportantGI: 0 522 | m_StitchLightmapSeams: 1 523 | m_SelectedEditorRenderState: 3 524 | m_MinimumChartSize: 4 525 | m_AutoUVMaxDistance: 0.5 526 | m_AutoUVMaxAngle: 89 527 | m_LightmapParameters: {fileID: 0} 528 | m_SortingLayerID: 0 529 | m_SortingLayer: 0 530 | m_SortingOrder: 0 531 | m_AdditionalVertexStreams: {fileID: 0} 532 | --- !u!64 &1648765065 533 | MeshCollider: 534 | m_ObjectHideFlags: 0 535 | m_CorrespondingSourceObject: {fileID: 0} 536 | m_PrefabInstance: {fileID: 0} 537 | m_PrefabAsset: {fileID: 0} 538 | m_GameObject: {fileID: 1648765062} 539 | m_Material: {fileID: 0} 540 | m_IsTrigger: 0 541 | m_Enabled: 1 542 | serializedVersion: 4 543 | m_Convex: 0 544 | m_CookingOptions: 30 545 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 546 | --- !u!33 &1648765066 547 | MeshFilter: 548 | m_ObjectHideFlags: 0 549 | m_CorrespondingSourceObject: {fileID: 0} 550 | m_PrefabInstance: {fileID: 0} 551 | m_PrefabAsset: {fileID: 0} 552 | m_GameObject: {fileID: 1648765062} 553 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 554 | --- !u!1 &1716710053 555 | GameObject: 556 | m_ObjectHideFlags: 0 557 | m_CorrespondingSourceObject: {fileID: 0} 558 | m_PrefabInstance: {fileID: 0} 559 | m_PrefabAsset: {fileID: 0} 560 | serializedVersion: 6 561 | m_Component: 562 | - component: {fileID: 1716710055} 563 | - component: {fileID: 1716710054} 564 | m_Layer: 0 565 | m_Name: Directional Light 566 | m_TagString: Untagged 567 | m_Icon: {fileID: 0} 568 | m_NavMeshLayer: 0 569 | m_StaticEditorFlags: 4294967295 570 | m_IsActive: 1 571 | --- !u!108 &1716710054 572 | Light: 573 | m_ObjectHideFlags: 0 574 | m_CorrespondingSourceObject: {fileID: 0} 575 | m_PrefabInstance: {fileID: 0} 576 | m_PrefabAsset: {fileID: 0} 577 | m_GameObject: {fileID: 1716710053} 578 | m_Enabled: 1 579 | serializedVersion: 10 580 | m_Type: 1 581 | m_Shape: 0 582 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 583 | m_Intensity: 1 584 | m_Range: 10 585 | m_SpotAngle: 30 586 | m_InnerSpotAngle: 21.80208 587 | m_CookieSize: 10 588 | m_Shadows: 589 | m_Type: 2 590 | m_Resolution: -1 591 | m_CustomResolution: -1 592 | m_Strength: 1 593 | m_Bias: 0.05 594 | m_NormalBias: 0.4 595 | m_NearPlane: 0.2 596 | m_CullingMatrixOverride: 597 | e00: 1 598 | e01: 0 599 | e02: 0 600 | e03: 0 601 | e10: 0 602 | e11: 1 603 | e12: 0 604 | e13: 0 605 | e20: 0 606 | e21: 0 607 | e22: 1 608 | e23: 0 609 | e30: 0 610 | e31: 0 611 | e32: 0 612 | e33: 1 613 | m_UseCullingMatrixOverride: 0 614 | m_Cookie: {fileID: 0} 615 | m_DrawHalo: 0 616 | m_Flare: {fileID: 0} 617 | m_RenderMode: 0 618 | m_CullingMask: 619 | serializedVersion: 2 620 | m_Bits: 4294967295 621 | m_RenderingLayerMask: 1 622 | m_Lightmapping: 4 623 | m_LightShadowCasterMode: 0 624 | m_AreaSize: {x: 1, y: 1} 625 | m_BounceIntensity: 1 626 | m_ColorTemperature: 6570 627 | m_UseColorTemperature: 0 628 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 629 | m_UseBoundingSphereOverride: 0 630 | m_UseViewFrustumForShadowCasterCull: 1 631 | m_ShadowRadius: 0 632 | m_ShadowAngle: 0 633 | --- !u!4 &1716710055 634 | Transform: 635 | m_ObjectHideFlags: 0 636 | m_CorrespondingSourceObject: {fileID: 0} 637 | m_PrefabInstance: {fileID: 0} 638 | m_PrefabAsset: {fileID: 0} 639 | m_GameObject: {fileID: 1716710053} 640 | m_LocalRotation: {x: 0.40821797, y: -0.23456973, z: 0.10938168, w: 0.87542605} 641 | m_LocalPosition: {x: 0, y: 20, z: 0} 642 | m_LocalScale: {x: 1, y: 1, z: 1} 643 | m_Children: [] 644 | m_Father: {fileID: 1796508633} 645 | m_RootOrder: 1 646 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 647 | --- !u!1 &1727216465 648 | GameObject: 649 | m_ObjectHideFlags: 0 650 | m_CorrespondingSourceObject: {fileID: 0} 651 | m_PrefabInstance: {fileID: 0} 652 | m_PrefabAsset: {fileID: 0} 653 | serializedVersion: 6 654 | m_Component: 655 | - component: {fileID: 1727216466} 656 | - component: {fileID: 1727216469} 657 | - component: {fileID: 1727216468} 658 | - component: {fileID: 1727216467} 659 | m_Layer: 0 660 | m_Name: Plane (2) 661 | m_TagString: Untagged 662 | m_Icon: {fileID: 0} 663 | m_NavMeshLayer: 0 664 | m_StaticEditorFlags: 4294967295 665 | m_IsActive: 1 666 | --- !u!4 &1727216466 667 | Transform: 668 | m_ObjectHideFlags: 0 669 | m_CorrespondingSourceObject: {fileID: 0} 670 | m_PrefabInstance: {fileID: 0} 671 | m_PrefabAsset: {fileID: 0} 672 | m_GameObject: {fileID: 1727216465} 673 | m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071067} 674 | m_LocalPosition: {x: 7.3, y: 5.66, z: 0} 675 | m_LocalScale: {x: 1, y: 1, z: 1} 676 | m_Children: [] 677 | m_Father: {fileID: 1796508633} 678 | m_RootOrder: 4 679 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} 680 | --- !u!23 &1727216467 681 | MeshRenderer: 682 | m_ObjectHideFlags: 0 683 | m_CorrespondingSourceObject: {fileID: 0} 684 | m_PrefabInstance: {fileID: 0} 685 | m_PrefabAsset: {fileID: 0} 686 | m_GameObject: {fileID: 1727216465} 687 | m_Enabled: 1 688 | m_CastShadows: 1 689 | m_ReceiveShadows: 1 690 | m_DynamicOccludee: 1 691 | m_MotionVectors: 1 692 | m_LightProbeUsage: 1 693 | m_ReflectionProbeUsage: 1 694 | m_RayTracingMode: 2 695 | m_RayTraceProcedural: 0 696 | m_RenderingLayerMask: 1 697 | m_RendererPriority: 0 698 | m_Materials: 699 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 700 | m_StaticBatchInfo: 701 | firstSubMesh: 0 702 | subMeshCount: 0 703 | m_StaticBatchRoot: {fileID: 0} 704 | m_ProbeAnchor: {fileID: 0} 705 | m_LightProbeVolumeOverride: {fileID: 0} 706 | m_ScaleInLightmap: 1 707 | m_ReceiveGI: 1 708 | m_PreserveUVs: 1 709 | m_IgnoreNormalsForChartDetection: 0 710 | m_ImportantGI: 0 711 | m_StitchLightmapSeams: 1 712 | m_SelectedEditorRenderState: 3 713 | m_MinimumChartSize: 4 714 | m_AutoUVMaxDistance: 0.5 715 | m_AutoUVMaxAngle: 89 716 | m_LightmapParameters: {fileID: 0} 717 | m_SortingLayerID: 0 718 | m_SortingLayer: 0 719 | m_SortingOrder: 0 720 | m_AdditionalVertexStreams: {fileID: 0} 721 | --- !u!64 &1727216468 722 | MeshCollider: 723 | m_ObjectHideFlags: 0 724 | m_CorrespondingSourceObject: {fileID: 0} 725 | m_PrefabInstance: {fileID: 0} 726 | m_PrefabAsset: {fileID: 0} 727 | m_GameObject: {fileID: 1727216465} 728 | m_Material: {fileID: 0} 729 | m_IsTrigger: 0 730 | m_Enabled: 1 731 | serializedVersion: 4 732 | m_Convex: 0 733 | m_CookingOptions: 30 734 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 735 | --- !u!33 &1727216469 736 | MeshFilter: 737 | m_ObjectHideFlags: 0 738 | m_CorrespondingSourceObject: {fileID: 0} 739 | m_PrefabInstance: {fileID: 0} 740 | m_PrefabAsset: {fileID: 0} 741 | m_GameObject: {fileID: 1727216465} 742 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 743 | --- !u!1 &1796508632 744 | GameObject: 745 | m_ObjectHideFlags: 0 746 | m_CorrespondingSourceObject: {fileID: 0} 747 | m_PrefabInstance: {fileID: 0} 748 | m_PrefabAsset: {fileID: 0} 749 | serializedVersion: 6 750 | m_Component: 751 | - component: {fileID: 1796508633} 752 | m_Layer: 0 753 | m_Name: World 754 | m_TagString: Untagged 755 | m_Icon: {fileID: 0} 756 | m_NavMeshLayer: 0 757 | m_StaticEditorFlags: 0 758 | m_IsActive: 1 759 | --- !u!4 &1796508633 760 | Transform: 761 | m_ObjectHideFlags: 0 762 | m_CorrespondingSourceObject: {fileID: 0} 763 | m_PrefabInstance: {fileID: 0} 764 | m_PrefabAsset: {fileID: 0} 765 | m_GameObject: {fileID: 1796508632} 766 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 767 | m_LocalPosition: {x: 0, y: 0, z: 0} 768 | m_LocalScale: {x: 1, y: 1, z: 1} 769 | m_Children: 770 | - {fileID: 1927921867} 771 | - {fileID: 1716710055} 772 | - {fileID: 1053708260} 773 | - {fileID: 1648765063} 774 | - {fileID: 1727216466} 775 | - {fileID: 2059848309} 776 | m_Father: {fileID: 0} 777 | m_RootOrder: 4 778 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 779 | --- !u!1 &1927921862 780 | GameObject: 781 | m_ObjectHideFlags: 0 782 | m_CorrespondingSourceObject: {fileID: 0} 783 | m_PrefabInstance: {fileID: 0} 784 | m_PrefabAsset: {fileID: 0} 785 | serializedVersion: 6 786 | m_Component: 787 | - component: {fileID: 1927921867} 788 | - component: {fileID: 1927921866} 789 | - component: {fileID: 1927921864} 790 | - component: {fileID: 1927921863} 791 | m_Layer: 0 792 | m_Name: Main Camera 793 | m_TagString: MainCamera 794 | m_Icon: {fileID: 0} 795 | m_NavMeshLayer: 0 796 | m_StaticEditorFlags: 4294967295 797 | m_IsActive: 1 798 | --- !u!81 &1927921863 799 | AudioListener: 800 | m_ObjectHideFlags: 0 801 | m_CorrespondingSourceObject: {fileID: 0} 802 | m_PrefabInstance: {fileID: 0} 803 | m_PrefabAsset: {fileID: 0} 804 | m_GameObject: {fileID: 1927921862} 805 | m_Enabled: 1 806 | --- !u!124 &1927921864 807 | Behaviour: 808 | m_ObjectHideFlags: 0 809 | m_CorrespondingSourceObject: {fileID: 0} 810 | m_PrefabInstance: {fileID: 0} 811 | m_PrefabAsset: {fileID: 0} 812 | m_GameObject: {fileID: 1927921862} 813 | m_Enabled: 1 814 | --- !u!20 &1927921866 815 | Camera: 816 | m_ObjectHideFlags: 0 817 | m_CorrespondingSourceObject: {fileID: 0} 818 | m_PrefabInstance: {fileID: 0} 819 | m_PrefabAsset: {fileID: 0} 820 | m_GameObject: {fileID: 1927921862} 821 | m_Enabled: 1 822 | serializedVersion: 2 823 | m_ClearFlags: 1 824 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} 825 | m_projectionMatrixMode: 1 826 | m_GateFitMode: 2 827 | m_FOVAxisMode: 0 828 | m_SensorSize: {x: 36, y: 24} 829 | m_LensShift: {x: 0, y: 0} 830 | m_FocalLength: 50 831 | m_NormalizedViewPortRect: 832 | serializedVersion: 2 833 | x: 0 834 | y: 0 835 | width: 1 836 | height: 1 837 | near clip plane: 0.3 838 | far clip plane: 1000 839 | field of view: 44 840 | orthographic: 0 841 | orthographic size: 5 842 | m_Depth: -1 843 | m_CullingMask: 844 | serializedVersion: 2 845 | m_Bits: 4294967295 846 | m_RenderingPath: -1 847 | m_TargetTexture: {fileID: 0} 848 | m_TargetDisplay: 0 849 | m_TargetEye: 3 850 | m_HDR: 0 851 | m_AllowMSAA: 1 852 | m_AllowDynamicResolution: 0 853 | m_ForceIntoRT: 0 854 | m_OcclusionCulling: 1 855 | m_StereoConvergence: 10 856 | m_StereoSeparation: 0.022 857 | --- !u!4 &1927921867 858 | Transform: 859 | m_ObjectHideFlags: 0 860 | m_CorrespondingSourceObject: {fileID: 0} 861 | m_PrefabInstance: {fileID: 0} 862 | m_PrefabAsset: {fileID: 0} 863 | m_GameObject: {fileID: 1927921862} 864 | m_LocalRotation: {x: 0.3163942, y: -0, z: -0, w: 0.9486278} 865 | m_LocalPosition: {x: 0, y: 18.24, z: -21.48} 866 | m_LocalScale: {x: 1, y: 1, z: 1} 867 | m_Children: [] 868 | m_Father: {fileID: 1796508633} 869 | m_RootOrder: 0 870 | m_LocalEulerAnglesHint: {x: 36.89, y: 0, z: 0} 871 | --- !u!1 &1991041081 872 | GameObject: 873 | m_ObjectHideFlags: 0 874 | m_CorrespondingSourceObject: {fileID: 0} 875 | m_PrefabInstance: {fileID: 0} 876 | m_PrefabAsset: {fileID: 0} 877 | serializedVersion: 6 878 | m_Component: 879 | - component: {fileID: 1991041084} 880 | - component: {fileID: 1991041083} 881 | m_Layer: 0 882 | m_Name: MultiPool Manager 883 | m_TagString: Untagged 884 | m_Icon: {fileID: 0} 885 | m_NavMeshLayer: 0 886 | m_StaticEditorFlags: 4294967295 887 | m_IsActive: 1 888 | --- !u!114 &1991041083 889 | MonoBehaviour: 890 | m_ObjectHideFlags: 0 891 | m_CorrespondingSourceObject: {fileID: 0} 892 | m_PrefabInstance: {fileID: 0} 893 | m_PrefabAsset: {fileID: 0} 894 | m_GameObject: {fileID: 1991041081} 895 | m_Enabled: 1 896 | m_EditorHideFlags: 0 897 | m_Script: {fileID: 11500000, guid: 7d7f04dff4ef2da4595c21655fb1b01a, type: 3} 898 | m_Name: 899 | m_EditorClassIdentifier: 900 | _pools: 901 | - _name: Red Bullets 902 | _objectReference: {fileID: 189844, guid: cb0eb6a42f416b64ea3fc7cc3093ada9, type: 3} 903 | _startAmount: 10 904 | _canGrow: 0 905 | _maxGrow: 0 906 | _customParent: {fileID: 1529322169} 907 | _disableIfGameObject: 1 908 | - _name: Blue Bullets 909 | _objectReference: {fileID: 196744, guid: 083bf09cb4df8814992509392539c29b, type: 3} 910 | _startAmount: 2 911 | _canGrow: 1 912 | _maxGrow: 10 913 | _customParent: {fileID: 1607543249} 914 | _disableIfGameObject: 1 915 | - _name: Green Bullets 916 | _objectReference: {fileID: 1496458675705708, guid: 087b0529ec0d9424cb30168b1a93734f, 917 | type: 3} 918 | _startAmount: 30 919 | _canGrow: 0 920 | _maxGrow: 0 921 | _customParent: {fileID: 1340512872} 922 | _disableIfGameObject: 1 923 | --- !u!4 &1991041084 924 | Transform: 925 | m_ObjectHideFlags: 0 926 | m_CorrespondingSourceObject: {fileID: 0} 927 | m_PrefabInstance: {fileID: 0} 928 | m_PrefabAsset: {fileID: 0} 929 | m_GameObject: {fileID: 1991041081} 930 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 931 | m_LocalPosition: {x: 0, y: 0, z: 0} 932 | m_LocalScale: {x: 1, y: 1, z: 1} 933 | m_Children: [] 934 | m_Father: {fileID: 0} 935 | m_RootOrder: 0 936 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 937 | --- !u!1 &2059848308 938 | GameObject: 939 | m_ObjectHideFlags: 0 940 | m_CorrespondingSourceObject: {fileID: 0} 941 | m_PrefabInstance: {fileID: 0} 942 | m_PrefabAsset: {fileID: 0} 943 | serializedVersion: 6 944 | m_Component: 945 | - component: {fileID: 2059848309} 946 | - component: {fileID: 2059848312} 947 | - component: {fileID: 2059848311} 948 | - component: {fileID: 2059848310} 949 | m_Layer: 0 950 | m_Name: Plane (3) 951 | m_TagString: Untagged 952 | m_Icon: {fileID: 0} 953 | m_NavMeshLayer: 0 954 | m_StaticEditorFlags: 4294967295 955 | m_IsActive: 1 956 | --- !u!4 &2059848309 957 | Transform: 958 | m_ObjectHideFlags: 0 959 | m_CorrespondingSourceObject: {fileID: 0} 960 | m_PrefabInstance: {fileID: 0} 961 | m_PrefabAsset: {fileID: 0} 962 | m_GameObject: {fileID: 2059848308} 963 | m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071067} 964 | m_LocalPosition: {x: -8.95, y: 0.42, z: 0} 965 | m_LocalScale: {x: 1, y: 1, z: 1} 966 | m_Children: [] 967 | m_Father: {fileID: 1796508633} 968 | m_RootOrder: 5 969 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} 970 | --- !u!23 &2059848310 971 | MeshRenderer: 972 | m_ObjectHideFlags: 0 973 | m_CorrespondingSourceObject: {fileID: 0} 974 | m_PrefabInstance: {fileID: 0} 975 | m_PrefabAsset: {fileID: 0} 976 | m_GameObject: {fileID: 2059848308} 977 | m_Enabled: 1 978 | m_CastShadows: 1 979 | m_ReceiveShadows: 1 980 | m_DynamicOccludee: 1 981 | m_MotionVectors: 1 982 | m_LightProbeUsage: 1 983 | m_ReflectionProbeUsage: 1 984 | m_RayTracingMode: 2 985 | m_RayTraceProcedural: 0 986 | m_RenderingLayerMask: 1 987 | m_RendererPriority: 0 988 | m_Materials: 989 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 990 | m_StaticBatchInfo: 991 | firstSubMesh: 0 992 | subMeshCount: 0 993 | m_StaticBatchRoot: {fileID: 0} 994 | m_ProbeAnchor: {fileID: 0} 995 | m_LightProbeVolumeOverride: {fileID: 0} 996 | m_ScaleInLightmap: 1 997 | m_ReceiveGI: 1 998 | m_PreserveUVs: 1 999 | m_IgnoreNormalsForChartDetection: 0 1000 | m_ImportantGI: 0 1001 | m_StitchLightmapSeams: 1 1002 | m_SelectedEditorRenderState: 3 1003 | m_MinimumChartSize: 4 1004 | m_AutoUVMaxDistance: 0.5 1005 | m_AutoUVMaxAngle: 89 1006 | m_LightmapParameters: {fileID: 0} 1007 | m_SortingLayerID: 0 1008 | m_SortingLayer: 0 1009 | m_SortingOrder: 0 1010 | m_AdditionalVertexStreams: {fileID: 0} 1011 | --- !u!64 &2059848311 1012 | MeshCollider: 1013 | m_ObjectHideFlags: 0 1014 | m_CorrespondingSourceObject: {fileID: 0} 1015 | m_PrefabInstance: {fileID: 0} 1016 | m_PrefabAsset: {fileID: 0} 1017 | m_GameObject: {fileID: 2059848308} 1018 | m_Material: {fileID: 0} 1019 | m_IsTrigger: 0 1020 | m_Enabled: 1 1021 | serializedVersion: 4 1022 | m_Convex: 0 1023 | m_CookingOptions: 30 1024 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 1025 | --- !u!33 &2059848312 1026 | MeshFilter: 1027 | m_ObjectHideFlags: 0 1028 | m_CorrespondingSourceObject: {fileID: 0} 1029 | m_PrefabInstance: {fileID: 0} 1030 | m_PrefabAsset: {fileID: 0} 1031 | m_GameObject: {fileID: 2059848308} 1032 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 1033 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8da3d87827224a49a61fd3e4d570e20 3 | timeCreated: 1477699146 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Samples~/Ball Demo/MultipoolDemo/LightingData.asset -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ffb72967ebbe544396fd5483c5dabcf 3 | timeCreated: 1492236092 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 25800000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdamCarballo/Unity-MultiPool/f8e2c2c1a9cc40a4e1b0934d7ac6ba7d9e833ce8/Samples~/Ball Demo/MultipoolDemo/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Samples~/Ball Demo/MultipoolDemo/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e78a11ade7818244b03f62a5f02904a 3 | timeCreated: 1492236091 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 1 27 | seamlessCubemap: 1 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | filterMode: 2 32 | aniso: 0 33 | mipBias: 0 34 | wrapMode: 1 35 | nPOTScale: 1 36 | lightmap: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: 0.5, y: 0.5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaUsage: 1 46 | alphaIsTransparency: 0 47 | spriteTessellationDetail: -1 48 | textureType: 0 49 | textureShape: 2 50 | maxTextureSizeSet: 0 51 | compressionQualitySet: 0 52 | textureFormatSet: 0 53 | platformSettings: 54 | - buildTarget: DefaultTexturePlatform 55 | maxTextureSize: 2048 56 | textureFormat: -1 57 | textureCompression: 1 58 | compressionQuality: 100 59 | crunchedCompression: 0 60 | allowsAlphaSplitting: 0 61 | overridden: 0 62 | spriteSheet: 63 | serializedVersion: 2 64 | sprites: [] 65 | outline: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | assetBundleVariant: 70 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51c1dd812f161b7489d10942d48c9f9c 3 | folderAsset: yes 4 | timeCreated: 1477699146 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs/Blue_Bullet.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &196744 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 493452} 12 | - component: {fileID: 3322122} 13 | - component: {fileID: 13565702} 14 | - component: {fileID: 2380838} 15 | - component: {fileID: 5461854} 16 | - component: {fileID: 11452334} 17 | m_Layer: 0 18 | m_Name: Blue_Bullet 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &493452 25 | Transform: 26 | m_ObjectHideFlags: 0 27 | m_CorrespondingSourceObject: {fileID: 0} 28 | m_PrefabInstance: {fileID: 0} 29 | m_PrefabAsset: {fileID: 0} 30 | m_GameObject: {fileID: 196744} 31 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 32 | m_LocalPosition: {x: 0, y: 0, z: 0} 33 | m_LocalScale: {x: 1, y: 1, z: 1} 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 38 | --- !u!33 &3322122 39 | MeshFilter: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 196744} 45 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 46 | --- !u!135 &13565702 47 | SphereCollider: 48 | m_ObjectHideFlags: 0 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInstance: {fileID: 0} 51 | m_PrefabAsset: {fileID: 0} 52 | m_GameObject: {fileID: 196744} 53 | m_Material: {fileID: 0} 54 | m_IsTrigger: 0 55 | m_Enabled: 1 56 | serializedVersion: 2 57 | m_Radius: 0.5 58 | m_Center: {x: 0, y: 0, z: 0} 59 | --- !u!23 &2380838 60 | MeshRenderer: 61 | m_ObjectHideFlags: 0 62 | m_CorrespondingSourceObject: {fileID: 0} 63 | m_PrefabInstance: {fileID: 0} 64 | m_PrefabAsset: {fileID: 0} 65 | m_GameObject: {fileID: 196744} 66 | m_Enabled: 1 67 | m_CastShadows: 1 68 | m_ReceiveShadows: 1 69 | m_DynamicOccludee: 1 70 | m_MotionVectors: 1 71 | m_LightProbeUsage: 1 72 | m_ReflectionProbeUsage: 1 73 | m_RayTracingMode: 2 74 | m_RayTraceProcedural: 0 75 | m_RenderingLayerMask: 1 76 | m_RendererPriority: 0 77 | m_Materials: 78 | - {fileID: 2100000, guid: 2987f78fa0fbe934ab29e69416bea49b, type: 2} 79 | m_StaticBatchInfo: 80 | firstSubMesh: 0 81 | subMeshCount: 0 82 | m_StaticBatchRoot: {fileID: 0} 83 | m_ProbeAnchor: {fileID: 0} 84 | m_LightProbeVolumeOverride: {fileID: 0} 85 | m_ScaleInLightmap: 1 86 | m_ReceiveGI: 1 87 | m_PreserveUVs: 1 88 | m_IgnoreNormalsForChartDetection: 0 89 | m_ImportantGI: 0 90 | m_StitchLightmapSeams: 1 91 | m_SelectedEditorRenderState: 3 92 | m_MinimumChartSize: 4 93 | m_AutoUVMaxDistance: 0.5 94 | m_AutoUVMaxAngle: 89 95 | m_LightmapParameters: {fileID: 0} 96 | m_SortingLayerID: 0 97 | m_SortingLayer: 0 98 | m_SortingOrder: 0 99 | m_AdditionalVertexStreams: {fileID: 0} 100 | --- !u!54 &5461854 101 | Rigidbody: 102 | m_ObjectHideFlags: 0 103 | m_CorrespondingSourceObject: {fileID: 0} 104 | m_PrefabInstance: {fileID: 0} 105 | m_PrefabAsset: {fileID: 0} 106 | m_GameObject: {fileID: 196744} 107 | serializedVersion: 2 108 | m_Mass: 1 109 | m_Drag: 0 110 | m_AngularDrag: 0.05 111 | m_UseGravity: 1 112 | m_IsKinematic: 0 113 | m_Interpolate: 0 114 | m_Constraints: 0 115 | m_CollisionDetection: 0 116 | --- !u!114 &11452334 117 | MonoBehaviour: 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInstance: {fileID: 0} 121 | m_PrefabAsset: {fileID: 0} 122 | m_GameObject: {fileID: 196744} 123 | m_Enabled: 1 124 | m_EditorHideFlags: 0 125 | m_Script: {fileID: 11500000, guid: f61570c47e611a548aa499eedc3c0843, type: 3} 126 | m_Name: 127 | m_EditorClassIdentifier: 128 | _time: 4 129 | _resetRigidbody: 1 130 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs/Blue_Bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 083bf09cb4df8814992509392539c29b 3 | timeCreated: 1477699146 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs/Green_Bullet.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1496458675705708 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4368681715483094} 12 | - component: {fileID: 33055817104218260} 13 | - component: {fileID: 135642589824439536} 14 | - component: {fileID: 23660349164343004} 15 | - component: {fileID: 54664264962825736} 16 | - component: {fileID: 114967338554038044} 17 | m_Layer: 0 18 | m_Name: Green_Bullet 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &4368681715483094 25 | Transform: 26 | m_ObjectHideFlags: 0 27 | m_CorrespondingSourceObject: {fileID: 0} 28 | m_PrefabInstance: {fileID: 0} 29 | m_PrefabAsset: {fileID: 0} 30 | m_GameObject: {fileID: 1496458675705708} 31 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 32 | m_LocalPosition: {x: -1.5345002, y: 6.68414, z: -10.428598} 33 | m_LocalScale: {x: 1, y: 1, z: 1} 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 38 | --- !u!33 &33055817104218260 39 | MeshFilter: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 1496458675705708} 45 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 46 | --- !u!135 &135642589824439536 47 | SphereCollider: 48 | m_ObjectHideFlags: 0 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInstance: {fileID: 0} 51 | m_PrefabAsset: {fileID: 0} 52 | m_GameObject: {fileID: 1496458675705708} 53 | m_Material: {fileID: 0} 54 | m_IsTrigger: 0 55 | m_Enabled: 1 56 | serializedVersion: 2 57 | m_Radius: 0.5 58 | m_Center: {x: 0, y: 0, z: 0} 59 | --- !u!23 &23660349164343004 60 | MeshRenderer: 61 | m_ObjectHideFlags: 0 62 | m_CorrespondingSourceObject: {fileID: 0} 63 | m_PrefabInstance: {fileID: 0} 64 | m_PrefabAsset: {fileID: 0} 65 | m_GameObject: {fileID: 1496458675705708} 66 | m_Enabled: 1 67 | m_CastShadows: 1 68 | m_ReceiveShadows: 1 69 | m_DynamicOccludee: 1 70 | m_MotionVectors: 1 71 | m_LightProbeUsage: 1 72 | m_ReflectionProbeUsage: 1 73 | m_RayTracingMode: 2 74 | m_RayTraceProcedural: 0 75 | m_RenderingLayerMask: 1 76 | m_RendererPriority: 0 77 | m_Materials: 78 | - {fileID: 2100000, guid: 8db5ac0e6aacbe24f93fe7179ba16f69, type: 2} 79 | m_StaticBatchInfo: 80 | firstSubMesh: 0 81 | subMeshCount: 0 82 | m_StaticBatchRoot: {fileID: 0} 83 | m_ProbeAnchor: {fileID: 0} 84 | m_LightProbeVolumeOverride: {fileID: 0} 85 | m_ScaleInLightmap: 1 86 | m_ReceiveGI: 1 87 | m_PreserveUVs: 1 88 | m_IgnoreNormalsForChartDetection: 0 89 | m_ImportantGI: 0 90 | m_StitchLightmapSeams: 1 91 | m_SelectedEditorRenderState: 3 92 | m_MinimumChartSize: 4 93 | m_AutoUVMaxDistance: 0.5 94 | m_AutoUVMaxAngle: 89 95 | m_LightmapParameters: {fileID: 0} 96 | m_SortingLayerID: 0 97 | m_SortingLayer: 0 98 | m_SortingOrder: 0 99 | m_AdditionalVertexStreams: {fileID: 0} 100 | --- !u!54 &54664264962825736 101 | Rigidbody: 102 | m_ObjectHideFlags: 0 103 | m_CorrespondingSourceObject: {fileID: 0} 104 | m_PrefabInstance: {fileID: 0} 105 | m_PrefabAsset: {fileID: 0} 106 | m_GameObject: {fileID: 1496458675705708} 107 | serializedVersion: 2 108 | m_Mass: 1 109 | m_Drag: 0 110 | m_AngularDrag: 0.05 111 | m_UseGravity: 1 112 | m_IsKinematic: 0 113 | m_Interpolate: 0 114 | m_Constraints: 0 115 | m_CollisionDetection: 0 116 | --- !u!114 &114967338554038044 117 | MonoBehaviour: 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInstance: {fileID: 0} 121 | m_PrefabAsset: {fileID: 0} 122 | m_GameObject: {fileID: 1496458675705708} 123 | m_Enabled: 1 124 | m_EditorHideFlags: 0 125 | m_Script: {fileID: 11500000, guid: f61570c47e611a548aa499eedc3c0843, type: 3} 126 | m_Name: 127 | m_EditorClassIdentifier: 128 | _time: 6 129 | _resetRigidbody: 1 130 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs/Green_Bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 087b0529ec0d9424cb30168b1a93734f 3 | timeCreated: 1492232742 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs/Red_Bullet.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &189844 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 408294} 12 | - component: {fileID: 3379702} 13 | - component: {fileID: 13506352} 14 | - component: {fileID: 2387768} 15 | - component: {fileID: 5494444} 16 | - component: {fileID: 11412606} 17 | m_Layer: 0 18 | m_Name: Red_Bullet 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &408294 25 | Transform: 26 | m_ObjectHideFlags: 0 27 | m_CorrespondingSourceObject: {fileID: 0} 28 | m_PrefabInstance: {fileID: 0} 29 | m_PrefabAsset: {fileID: 0} 30 | m_GameObject: {fileID: 189844} 31 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 32 | m_LocalPosition: {x: 0, y: 0, z: 0} 33 | m_LocalScale: {x: 1, y: 1, z: 1} 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 38 | --- !u!33 &3379702 39 | MeshFilter: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 189844} 45 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 46 | --- !u!135 &13506352 47 | SphereCollider: 48 | m_ObjectHideFlags: 0 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInstance: {fileID: 0} 51 | m_PrefabAsset: {fileID: 0} 52 | m_GameObject: {fileID: 189844} 53 | m_Material: {fileID: 0} 54 | m_IsTrigger: 0 55 | m_Enabled: 1 56 | serializedVersion: 2 57 | m_Radius: 0.5 58 | m_Center: {x: 0, y: 0, z: 0} 59 | --- !u!23 &2387768 60 | MeshRenderer: 61 | m_ObjectHideFlags: 0 62 | m_CorrespondingSourceObject: {fileID: 0} 63 | m_PrefabInstance: {fileID: 0} 64 | m_PrefabAsset: {fileID: 0} 65 | m_GameObject: {fileID: 189844} 66 | m_Enabled: 1 67 | m_CastShadows: 1 68 | m_ReceiveShadows: 1 69 | m_DynamicOccludee: 1 70 | m_MotionVectors: 1 71 | m_LightProbeUsage: 1 72 | m_ReflectionProbeUsage: 1 73 | m_RayTracingMode: 2 74 | m_RayTraceProcedural: 0 75 | m_RenderingLayerMask: 1 76 | m_RendererPriority: 0 77 | m_Materials: 78 | - {fileID: 2100000, guid: 734d12a8442bf0b409d5c6a05a39a34f, type: 2} 79 | m_StaticBatchInfo: 80 | firstSubMesh: 0 81 | subMeshCount: 0 82 | m_StaticBatchRoot: {fileID: 0} 83 | m_ProbeAnchor: {fileID: 0} 84 | m_LightProbeVolumeOverride: {fileID: 0} 85 | m_ScaleInLightmap: 1 86 | m_ReceiveGI: 1 87 | m_PreserveUVs: 1 88 | m_IgnoreNormalsForChartDetection: 0 89 | m_ImportantGI: 0 90 | m_StitchLightmapSeams: 1 91 | m_SelectedEditorRenderState: 3 92 | m_MinimumChartSize: 4 93 | m_AutoUVMaxDistance: 0.5 94 | m_AutoUVMaxAngle: 89 95 | m_LightmapParameters: {fileID: 0} 96 | m_SortingLayerID: 0 97 | m_SortingLayer: 0 98 | m_SortingOrder: 0 99 | m_AdditionalVertexStreams: {fileID: 0} 100 | --- !u!54 &5494444 101 | Rigidbody: 102 | m_ObjectHideFlags: 0 103 | m_CorrespondingSourceObject: {fileID: 0} 104 | m_PrefabInstance: {fileID: 0} 105 | m_PrefabAsset: {fileID: 0} 106 | m_GameObject: {fileID: 189844} 107 | serializedVersion: 2 108 | m_Mass: 1 109 | m_Drag: 0 110 | m_AngularDrag: 0.05 111 | m_UseGravity: 1 112 | m_IsKinematic: 0 113 | m_Interpolate: 0 114 | m_Constraints: 0 115 | m_CollisionDetection: 0 116 | --- !u!114 &11412606 117 | MonoBehaviour: 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInstance: {fileID: 0} 121 | m_PrefabAsset: {fileID: 0} 122 | m_GameObject: {fileID: 189844} 123 | m_Enabled: 1 124 | m_EditorHideFlags: 0 125 | m_Script: {fileID: 11500000, guid: f61570c47e611a548aa499eedc3c0843, type: 3} 126 | m_Name: 127 | m_EditorClassIdentifier: 128 | _time: 6 129 | _resetRigidbody: 1 130 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Prefabs/Red_Bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb0eb6a42f416b64ea3fc7cc3093ada9 3 | timeCreated: 1477699148 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73cfedd83ff28f7428521f962d21c3ee 3 | folderAsset: yes 4 | timeCreated: 1477699146 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Samples~/Ball Demo/Scripts/BulletStartDemo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * BulletStartDemo.cs 3 | * Demo Script. Uses Generate() to get an object from the MultipoolEmitter selected pool. 4 | * 5 | * Just calling Generate() from the MultipoolEmitter is enough to obtain an object from the pool. 6 | * 7 | * This script generates an object every fireTime and resets his position and rotation. 8 | * 9 | * by Adam Carballo under MIT license. 10 | * https://github.com/AdamCarballo/Unity-MultiPool 11 | */ 12 | 13 | using UnityEngine; 14 | using System.Collections; 15 | using F10.Multipool; 16 | 17 | public class BulletStartDemo : MonoBehaviour { 18 | 19 | [Range(0.1f, 2f)] 20 | [SerializeField] 21 | private float _fireTime; 22 | private MultipoolEmitter _emitter; 23 | 24 | /// 25 | /// Reference the Emitter. 26 | /// 27 | private void Awake() { 28 | _emitter = GetComponent(); 29 | } 30 | 31 | /// 32 | /// Start generating each fireTime. 33 | /// 34 | private void Start() { 35 | StartCoroutine(SpawnNew()); 36 | } 37 | 38 | /// 39 | /// Retrieve from the object pool, check if null, reset position, rotation and set active. 40 | /// 41 | private IEnumerator SpawnNew() { 42 | while (true) { 43 | var obj = _emitter.GenerateGameObject(); 44 | 45 | if (obj != null) { 46 | var thisTransform = transform; 47 | obj.transform.position = thisTransform.position; 48 | obj.transform.rotation = thisTransform.rotation; 49 | } 50 | 51 | yield return new WaitForSeconds(_fireTime); 52 | } 53 | 54 | // ReSharper disable once IteratorNeverReturns 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /Samples~/Ball Demo/Scripts/BulletStartDemo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7a3fc5bb03cecc449fec96a1b3ea773 3 | timeCreated: 1477699146 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.adamcarballo.multipool", 3 | "displayName": "MultiPool", 4 | "version": "2.0.0", 5 | "unity": "2018.4", 6 | "keywords": [ 7 | "gameobject", 8 | "pooling", 9 | "object", 10 | "instantiate", 11 | "emitter" 12 | ], 13 | "description": "Expandable Object Pooling for Unity.", 14 | "repository": { 15 | "url": "https://github.com/AdamCarballo/Unity-MultiPool.git", 16 | "type": "git" 17 | }, 18 | "type": "tool", 19 | "hideInEditor": false, 20 | "samples": [ 21 | { 22 | "displayName": "Demo Scene", 23 | "description": "Example of multiple prefabs using the same MultiPool with different settings.", 24 | "path": "Samples~/Ball Demo" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09d1f98baae89284084e754e38f6e0b0 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------