├── .gitignore ├── Documentation ├── inventory1.gif ├── renderer.png └── shape-property.png ├── LICENSE ├── README.md └── Unity Project ├── .idea └── .idea.Unity Project │ ├── .idea │ ├── contentModel.xml │ ├── encodings.xml │ ├── indexLayout.xml │ ├── modules.xml │ ├── projectSettingsUpdater.xml │ └── vcs.xml │ └── riderModule.iml ├── .vscode └── settings.json ├── Assets ├── Example.meta └── Example │ ├── Inventories.prefab │ ├── Inventories.prefab.meta │ ├── Inventory Camera.unity │ ├── Inventory Camera.unity.meta │ ├── Inventory Overlay.unity │ ├── Inventory Overlay.unity.meta │ ├── Inventory World Space.unity │ ├── Inventory World Space.unity.meta │ ├── InventoryProvider.cs │ ├── InventoryProvider.cs.meta │ ├── InventorySelection.cs │ ├── InventorySelection.cs.meta │ ├── ItemDefinition.cs │ ├── ItemDefinition.cs.meta │ ├── ItemTypes.cs │ ├── ItemTypes.cs.meta │ ├── Items.meta │ ├── Items │ ├── Dagger.asset │ ├── Dagger.asset.meta │ ├── Gadget.asset │ ├── Gadget.asset.meta │ ├── Green Vial.asset │ ├── Green Vial.asset.meta │ ├── Ray Gun.asset │ ├── Ray Gun.asset.meta │ ├── Red Vial.asset │ ├── Red Vial.asset.meta │ ├── Stun Baton.asset │ └── Stun Baton.asset.meta │ ├── SizeInventoryExample.cs │ ├── SizeInventoryExample.cs.meta │ ├── inventory.png │ └── inventory.png.meta ├── Logs └── Packages-Update.log ├── Packages ├── FarrokGames.Inventory │ ├── Editor.meta │ ├── Editor │ │ ├── Farrokhgames.Inventory.Editor.asmdef │ │ ├── Farrokhgames.Inventory.Editor.asmdef.meta │ │ ├── InventoryShapePropertyDrawer.cs │ │ └── InventoryShapePropertyDrawer.cs.meta │ ├── LICENSE.md │ ├── LICENSE.md.meta │ ├── README.md │ ├── README.md.meta │ ├── Runtime.meta │ ├── Runtime │ │ ├── Farrokhgames.Inventory.asmdef │ │ ├── Farrokhgames.Inventory.asmdef.meta │ │ ├── IInventoryItem.cs │ │ ├── IInventoryItem.cs.meta │ │ ├── IInventoryManager.cs │ │ ├── IInventoryManager.cs.meta │ │ ├── IInventoryProvider.cs │ │ ├── IInventoryProvider.cs.meta │ │ ├── InventoryController.cs │ │ ├── InventoryController.cs.meta │ │ ├── InventoryDraggedItem.cs │ │ ├── InventoryDraggedItem.cs.meta │ │ ├── InventoryManager.cs │ │ ├── InventoryManager.cs.meta │ │ ├── InventoryRenderMode.cs │ │ ├── InventoryRenderMode.cs.meta │ │ ├── InventoryRenderer.cs │ │ ├── InventoryRenderer.cs.meta │ │ ├── InventoryShape.cs │ │ ├── InventoryShape.cs.meta │ │ ├── Pool.cs │ │ └── Pool.cs.meta │ ├── Tests.meta │ ├── Tests │ │ ├── Farrokhgames.Inventory.Tests.asmdef │ │ ├── Farrokhgames.Inventory.Tests.asmdef.meta │ │ ├── InventoryManagerTests.cs │ │ ├── InventoryManagerTests.cs.meta │ │ ├── InventoryShapeTests.cs │ │ ├── InventoryShapeTests.cs.meta │ │ ├── PoolTests.cs │ │ ├── PoolTests.cs.meta │ │ ├── TestItem.cs │ │ ├── TestItem.cs.meta │ │ ├── TestProvider.cs │ │ └── TestProvider.cs.meta │ ├── package.json │ └── package.json.meta └── manifest.json └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── XRSettings.asset └── editorsettings.asset /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | Temp/ 5 | Obj/ 6 | UnityGenerated/ 7 | Library/ 8 | Unity Project/Temp/ 9 | Unity Project/Obj/ 10 | Unity Project/UnityGenerated/ 11 | Unity Project/Library/ 12 | 13 | # ===================================== # 14 | # Visual Studio / MonoDevelop generated # 15 | # ===================================== # 16 | ExportedObj/ 17 | *.svd 18 | *.userprefs 19 | *.csproj 20 | *.pidb 21 | *.suo 22 | *.sln 23 | *.user 24 | *.unityproj 25 | *.booproj 26 | 27 | # ============ # 28 | # OS generated # 29 | # ============ # 30 | .DS_Store 31 | .DS_Store? 32 | ._* 33 | .Spotlight-V100 34 | .Trashes 35 | Icon? 36 | ehthumbs.db 37 | Thumbs.db -------------------------------------------------------------------------------- /Documentation/inventory1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarrokhGames/Inventory/174f55d1d03cc9742c367020c491fd03508834a9/Documentation/inventory1.gif -------------------------------------------------------------------------------- /Documentation/renderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarrokhGames/Inventory/174f55d1d03cc9742c367020c491fd03508834a9/Documentation/renderer.png -------------------------------------------------------------------------------- /Documentation/shape-property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarrokhGames/Inventory/174f55d1d03cc9742c367020c491fd03508834a9/Documentation/shape-property.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Farrokh Games 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## A Diablo 2-style inventory system for Unity3D 2 | 3 | The Inventory 4 | 5 | ## Table of Contents 6 | - Features 7 | - Installation 8 | - Example 9 | - Documentation 10 | - Getting Started 11 | - The Inventory 12 | - Items 13 | - Rendering the Inventory 14 | - Interacting with the Inventory 15 | - Other files included 16 | - License 17 | 18 | --- 19 | 20 | ## Features 21 | - ```Resize``` at runtime, dropping what no longer fits. 22 | - ```Add/Remove``` and check if an item fits from code. 23 | - ```Equipment slots``` for all your RPG needs. 24 | - ```Custom shapes``` for each item. 25 | - Rearrange items by ```draggin and dropping```, with visual feedback. 26 | - ```Move items between inventories```. 27 | - Remove items by ```dropping``` them outside the inventory. 28 | - Easily add ```custom graphics``` and change the size of your inventory. 29 | - Supports ```scaled canvases```. 30 | - Tested thoroughly with over ```75 Unit Tests```, and profiled using the Unity Profiler. 31 | - Tested using all types of ```Canvas render modes``` (Screen Space Overlay, Screen Space Camera and World Space) 32 | 33 | --- 34 | 35 | ## Installation 36 | Simply copy the folder "```Packages/FarrokGames.Inventory```" into your own projects packages folder and you're good to go. Optionally, you can add the folder "```Assets/Example```" to get started right away. 37 | 38 | --- 39 | 40 | ## Example 41 | A fully functional example is included with this reposetory and can be found in the folder "```Assets/Example```". 42 | 43 | - ```Inventory Overlay.scene``` - the Unity Scene that contains an example using the Canvas render mode of Screen Space Overlay. 44 | - ```Inventory Camera.scene``` - the Unity Scene that contains an example using the Canvas render mode of Screen Space Camera. 45 | - ```Inventory World Space.scene``` - the Unity Scene that contains an example using the Canvas render mode of World Space. 46 | - ```Inventory.png``` - includes all artwork used in the example. 47 | - ```ItemDefinition.cs``` - a ```ScriptableObject``` implemetation of ```IInventoryItem```. 48 | - ```SizeInventoryExample.cs``` - a ```MonoBehaviour``` that creates and connects an Inventory with a Renderer, and fills it with items. 49 | - ```Items-folder``` - Contains the ```ItemDefinitions``` used in the example. 50 | 51 | --- 52 | 53 | ## Documentation 54 | Below you can find documentation of various parts of the system. You are encouraged to look through the code, where more in-depth code docs can be found. 55 | 56 | --- 57 | 58 | ### Getting Started 59 | Creating a new inventory is simple. Remember that the inventory system rests within its own namespace, so don't forget to add ```using FarrokhGames.Inventory```. 60 | ```cs 61 | var inventory = new InventoryManager(8, 4); // Creates an inventory with a width of 8 and height of 4 62 | ``` 63 | 64 | --- 65 | 66 | ### The Inventory 67 | Below is a list of actions methods and getters within ```InventoryManager.cs```. 68 | ```cs 69 | /// 70 | /// Invoked when an item is added to the inventory 71 | /// 72 | Action onItemAdded { get; set; } 73 | 74 | /// 75 | /// Invoked when an item was not able to be added to the inventory 76 | /// 77 | Action onItemAddedFailed { get; set; } 78 | 79 | /// 80 | /// Invoked when an item is removed to the inventory 81 | /// 82 | Action onItemRemoved { get; set; } 83 | 84 | /// 85 | /// Invoked when an item is removed from the inventory and should be placed on the ground. 86 | /// 87 | Action onItemDropped { get; set; } 88 | 89 | /// 90 | /// Invoked when an item was unable to be placed on the ground (most likely to its canDrop being set to false) 91 | /// 92 | Action onItemDroppedFailed { get; set; } 93 | 94 | /// 95 | /// Invoked when the inventory is rebuilt from scratch 96 | /// 97 | Action onRebuilt { get; set; } 98 | 99 | /// 100 | /// Invoked when the inventory changes its size 101 | /// 102 | Action onResized { get; set; } 103 | 104 | /// 105 | /// The width of the inventory 106 | /// 107 | int width { get; } 108 | 109 | /// 110 | /// The height of the inventory 111 | /// 112 | int height { get; } 113 | 114 | /// 115 | /// Sets a new width and height of the inventory 116 | /// 117 | void Resize(int width, int height); 118 | 119 | /// 120 | /// Returns all items inside this inventory 121 | /// 122 | IInventoryItem[] allItems { get; } 123 | 124 | /// 125 | /// Returns true if given item is present in this inventory 126 | /// 127 | bool Contains(IInventoryItem item); 128 | 129 | /// 130 | /// Returns true if this inventory is full 131 | /// 132 | bool isFull { get; } 133 | 134 | /// 135 | /// Returns true if its possible to add given item 136 | /// 137 | bool CanAdd(IInventoryItem item); 138 | 139 | /// 140 | /// Add given item to the inventory. Returns true 141 | /// if successful 142 | /// 143 | bool TryAdd(IInventoryItem item); 144 | 145 | /// 146 | /// Returns true if its possible to add item at location 147 | /// 148 | bool CanAddAt(IInventoryItem item, Vector2Int point); 149 | 150 | /// 151 | /// Tries to add item att location and returns true if successful 152 | /// 153 | bool TryAddAt(IInventoryItem item, Vector2Int point); 154 | 155 | /// 156 | /// Returns true if its possible to remove this item 157 | /// 158 | bool CanRemove(IInventoryItem item); 159 | 160 | /// 161 | /// Returns true ifits possible to swap this item 162 | /// 163 | bool CanSwap(IInventoryItem item); 164 | 165 | /// 166 | /// Removes given item from this inventory. Returns 167 | /// true if successful. 168 | /// 169 | bool TryRemove(IInventoryItem item); 170 | 171 | /// 172 | /// Returns true if its possible to drop this item 173 | /// 174 | bool CanDrop(IInventoryItem item); 175 | 176 | /// 177 | /// Removes an item from this inventory. Returns true 178 | /// if successful. 179 | /// 180 | bool TryDrop(IInventoryItem item); 181 | 182 | /// 183 | /// Drops all items from this inventory 184 | /// 185 | void DropAll(); 186 | 187 | /// 188 | /// Clears (destroys) all items in this inventory 189 | /// 190 | void Clear(); 191 | 192 | /// 193 | /// Rebuilds the inventory 194 | /// 195 | void Rebuild(); 196 | 197 | /// 198 | /// Get an item at given point within this inventory 199 | /// 200 | IInventoryItem GetAtPoint(Vector2Int point); 201 | 202 | /// 203 | /// Returns all items under given rectangle 204 | /// 205 | IInventoryItem[] GetAtPoint(Vector2Int point, Vector2Int size); 206 | ``` 207 | --- 208 | 209 | ### Items 210 | Items inside the inventory are represented by the IInventoryItem interface. In the included example, this interface is attached to a ```ScritableObject``` making it possible to create, store and change item details in the asset folder. 211 | ```cs 212 | using UnityEngine; 213 | using FarrokhGames.Inventory; 214 | 215 | /// 216 | /// ScriptableObject representing an Inventory Item 217 | /// 218 | [CreateAssetMenu(fileName = "Item", menuName = "Inventory/Item", order = 1)] 219 | public class ItemDefinition : ScriptableObject, IInventoryItem 220 | { 221 | [SerializeField] private Sprite _sprite; 222 | [SerializeField] private InventoryShape _shape; 223 | [SerializeField] private bool _canDrop; 224 | 225 | public string Name => return this.name; 226 | public Sprite Sprite => return _sprite; 227 | public InventoryShape Shape => _shape; 228 | public bool canDrop => _canDrop; 229 | 230 | /// 231 | /// Creates a copy if this scriptable object 232 | /// 233 | public IInventoryItem CreateInstance() 234 | { 235 | return ScriptableObject.Instantiate(this); 236 | } 237 | } 238 | ``` 239 | The shape of an item is defined by the serializable ```ItemShape.cs``` class which has a useful property drawer. 240 | 241 | Zenject 242 | 243 | --- 244 | 245 | ### Rendering the Inventory 246 | The inventory system comes with a renderer in a MonoBehaviour called ```InventoryRenderer.cs```. 247 | 248 | Zenject 249 | 250 | Simply add this to a ```GameObject``` within your ```Canvas```, and connect it to an inventory using the following code. 251 | 252 | ```cs 253 | /// 254 | /// Set what inventory to use when rendering 255 | /// 256 | /// Inventory to use 257 | public void SetInventory(InventoryManager inventory); 258 | ``` 259 | 260 | *Please see the image at the top of this document as an example of how the rendering looks* 261 | 262 | --- 263 | 264 | ### Interacting with the Inventory 265 | To enable interactions (drag and drop), add ```InventoryController.cs``` to the same ```GameObject``` as your renderer. 266 | 267 | --- 268 | 269 | ### Other files included 270 | Besides the actual inventory, there are sipport-classes included in the reposetory. 271 | 272 | - ```Pool.cs``` - A generic pool of objects that can be retrieved and recycled without invoking additional allocations. Used by the ```Renderer``` to pool sprites. 273 | 274 | **You are free to use these** support-classes under the same license, and their ```Unit Tests``` are included. 275 | 276 | --- 277 | 278 | ## License 279 | MIT License 280 | 281 | Copyright (c) 2020 Farrokh Games 282 | 283 | Permission is hereby granted, free of charge, to any person obtaining a copy 284 | of this software and associated documentation files (the "Software"), to deal 285 | in the Software without restriction, including without limitation the rights 286 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 287 | copies of the Software, and to permit persons to whom the Software is 288 | furnished to do so, subject to the following conditions: 289 | 290 | The above copyright notice and this permission notice shall be included in all 291 | copies or substantial portions of the Software. 292 | 293 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 294 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 295 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 296 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 297 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 298 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 299 | SOFTWARE. 300 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/.idea/contentModel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Library/PackageCache/com.unity.collab-proxy@1.2.16 7 | Library/PackageCache/com.unity.ext.nunit@1.0.0 8 | Library/PackageCache/com.unity.ide.vscode@1.1.4 9 | Library/PackageCache/com.unity.test-framework@1.1.9 10 | Library/PackageCache/com.unity.textmeshpro@2.0.1 11 | Library/PackageCache/com.unity.xr.legacyinputhelpers@2.0.2 12 | Packages 13 | ProjectSettings 14 | 15 | 16 | .idea 17 | .vscode 18 | Library 19 | Logs 20 | Temp 21 | obj 22 | 23 | 24 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/.idea/projectSettingsUpdater.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Unity Project/.idea/.idea.Unity Project/riderModule.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Unity Project/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Unity Project/Assets/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a2185600db2a46f4a377abc9e5f097e 3 | folderAsset: yes 4 | timeCreated: 1509490923 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Inventories.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48a3257b2fa87467d8f95a41140cd3ce 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Inventory Camera.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f73292cb172884e46a8ec1fde0f4ac75 3 | timeCreated: 1481784028 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Inventory Overlay.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: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 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: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 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: 0 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: 1 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: 256 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: 0 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: 0} 101 | m_UseShadowmask: 0 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &466132161 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 466132164} 133 | - component: {fileID: 466132163} 134 | - component: {fileID: 466132162} 135 | m_Layer: 0 136 | m_Name: EventSystem 137 | m_TagString: Untagged 138 | m_Icon: {fileID: 0} 139 | m_NavMeshLayer: 0 140 | m_StaticEditorFlags: 0 141 | m_IsActive: 1 142 | --- !u!114 &466132162 143 | MonoBehaviour: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 466132161} 149 | m_Enabled: 1 150 | m_EditorHideFlags: 0 151 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 152 | m_Name: 153 | m_EditorClassIdentifier: 154 | m_HorizontalAxis: Horizontal 155 | m_VerticalAxis: Vertical 156 | m_SubmitButton: Submit 157 | m_CancelButton: Cancel 158 | m_InputActionsPerSecond: 10 159 | m_RepeatDelay: 0.5 160 | m_ForceModuleActive: 0 161 | --- !u!114 &466132163 162 | MonoBehaviour: 163 | m_ObjectHideFlags: 0 164 | m_CorrespondingSourceObject: {fileID: 0} 165 | m_PrefabInstance: {fileID: 0} 166 | m_PrefabAsset: {fileID: 0} 167 | m_GameObject: {fileID: 466132161} 168 | m_Enabled: 1 169 | m_EditorHideFlags: 0 170 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 171 | m_Name: 172 | m_EditorClassIdentifier: 173 | m_FirstSelected: {fileID: 0} 174 | m_sendNavigationEvents: 1 175 | m_DragThreshold: 5 176 | --- !u!4 &466132164 177 | Transform: 178 | m_ObjectHideFlags: 0 179 | m_CorrespondingSourceObject: {fileID: 0} 180 | m_PrefabInstance: {fileID: 0} 181 | m_PrefabAsset: {fileID: 0} 182 | m_GameObject: {fileID: 466132161} 183 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 184 | m_LocalPosition: {x: 0, y: 0, z: 0} 185 | m_LocalScale: {x: 1, y: 1, z: 1} 186 | m_Children: [] 187 | m_Father: {fileID: 0} 188 | m_RootOrder: 2 189 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 190 | --- !u!1 &876042626 191 | GameObject: 192 | m_ObjectHideFlags: 0 193 | m_CorrespondingSourceObject: {fileID: 0} 194 | m_PrefabInstance: {fileID: 0} 195 | m_PrefabAsset: {fileID: 0} 196 | serializedVersion: 6 197 | m_Component: 198 | - component: {fileID: 876042631} 199 | - component: {fileID: 876042630} 200 | m_Layer: 0 201 | m_Name: Main Camera 202 | m_TagString: MainCamera 203 | m_Icon: {fileID: 0} 204 | m_NavMeshLayer: 0 205 | m_StaticEditorFlags: 0 206 | m_IsActive: 1 207 | --- !u!20 &876042630 208 | Camera: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInstance: {fileID: 0} 212 | m_PrefabAsset: {fileID: 0} 213 | m_GameObject: {fileID: 876042626} 214 | m_Enabled: 1 215 | serializedVersion: 2 216 | m_ClearFlags: 2 217 | m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} 218 | m_projectionMatrixMode: 1 219 | m_GateFitMode: 2 220 | m_FOVAxisMode: 0 221 | m_SensorSize: {x: 36, y: 24} 222 | m_LensShift: {x: 0, y: 0} 223 | m_FocalLength: 50 224 | m_NormalizedViewPortRect: 225 | serializedVersion: 2 226 | x: 0 227 | y: 0 228 | width: 1 229 | height: 1 230 | near clip plane: -10 231 | far clip plane: 10 232 | field of view: 60 233 | orthographic: 1 234 | orthographic size: 5 235 | m_Depth: -1 236 | m_CullingMask: 237 | serializedVersion: 2 238 | m_Bits: 4294967295 239 | m_RenderingPath: -1 240 | m_TargetTexture: {fileID: 0} 241 | m_TargetDisplay: 0 242 | m_TargetEye: 3 243 | m_HDR: 0 244 | m_AllowMSAA: 1 245 | m_AllowDynamicResolution: 0 246 | m_ForceIntoRT: 0 247 | m_OcclusionCulling: 1 248 | m_StereoConvergence: 10 249 | m_StereoSeparation: 0.022 250 | --- !u!4 &876042631 251 | Transform: 252 | m_ObjectHideFlags: 0 253 | m_CorrespondingSourceObject: {fileID: 0} 254 | m_PrefabInstance: {fileID: 0} 255 | m_PrefabAsset: {fileID: 0} 256 | m_GameObject: {fileID: 876042626} 257 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 258 | m_LocalPosition: {x: 0, y: 0, z: -10} 259 | m_LocalScale: {x: 1, y: 1, z: 1} 260 | m_Children: [] 261 | m_Father: {fileID: 0} 262 | m_RootOrder: 0 263 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 264 | --- !u!1001 &1367319694 265 | PrefabInstance: 266 | m_ObjectHideFlags: 0 267 | serializedVersion: 2 268 | m_Modification: 269 | m_TransformParent: {fileID: 1980279642} 270 | m_Modifications: 271 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 272 | type: 3} 273 | propertyPath: m_LocalPosition.x 274 | value: 0 275 | objectReference: {fileID: 0} 276 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 277 | type: 3} 278 | propertyPath: m_LocalPosition.y 279 | value: 0 280 | objectReference: {fileID: 0} 281 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 282 | type: 3} 283 | propertyPath: m_LocalPosition.z 284 | value: 0 285 | objectReference: {fileID: 0} 286 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 287 | type: 3} 288 | propertyPath: m_LocalRotation.x 289 | value: 0 290 | objectReference: {fileID: 0} 291 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 292 | type: 3} 293 | propertyPath: m_LocalRotation.y 294 | value: 0 295 | objectReference: {fileID: 0} 296 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 297 | type: 3} 298 | propertyPath: m_LocalRotation.z 299 | value: 0 300 | objectReference: {fileID: 0} 301 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 302 | type: 3} 303 | propertyPath: m_LocalRotation.w 304 | value: 1 305 | objectReference: {fileID: 0} 306 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 307 | type: 3} 308 | propertyPath: m_RootOrder 309 | value: 0 310 | objectReference: {fileID: 0} 311 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 312 | type: 3} 313 | propertyPath: m_AnchoredPosition.x 314 | value: 0 315 | objectReference: {fileID: 0} 316 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 317 | type: 3} 318 | propertyPath: m_AnchoredPosition.y 319 | value: 12 320 | objectReference: {fileID: 0} 321 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 322 | type: 3} 323 | propertyPath: m_SizeDelta.x 324 | value: 0 325 | objectReference: {fileID: 0} 326 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 327 | type: 3} 328 | propertyPath: m_SizeDelta.y 329 | value: 0 330 | objectReference: {fileID: 0} 331 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 332 | type: 3} 333 | propertyPath: m_AnchorMin.x 334 | value: 0 335 | objectReference: {fileID: 0} 336 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 337 | type: 3} 338 | propertyPath: m_AnchorMin.y 339 | value: 0 340 | objectReference: {fileID: 0} 341 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 342 | type: 3} 343 | propertyPath: m_AnchorMax.x 344 | value: 1 345 | objectReference: {fileID: 0} 346 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 347 | type: 3} 348 | propertyPath: m_AnchorMax.y 349 | value: 1 350 | objectReference: {fileID: 0} 351 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 352 | type: 3} 353 | propertyPath: m_Pivot.x 354 | value: 0.5 355 | objectReference: {fileID: 0} 356 | - target: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 357 | type: 3} 358 | propertyPath: m_Pivot.y 359 | value: 0.5 360 | objectReference: {fileID: 0} 361 | - target: {fileID: 224525799100627122, guid: 48a3257b2fa87467d8f95a41140cd3ce, 362 | type: 3} 363 | propertyPath: m_AnchorMin.y 364 | value: 0 365 | objectReference: {fileID: 0} 366 | - target: {fileID: 224525799100627122, guid: 48a3257b2fa87467d8f95a41140cd3ce, 367 | type: 3} 368 | propertyPath: m_AnchorMax.y 369 | value: 0 370 | objectReference: {fileID: 0} 371 | - target: {fileID: 224525799100627122, guid: 48a3257b2fa87467d8f95a41140cd3ce, 372 | type: 3} 373 | propertyPath: m_AnchoredPosition.x 374 | value: 0 375 | objectReference: {fileID: 0} 376 | - target: {fileID: 224525799100627122, guid: 48a3257b2fa87467d8f95a41140cd3ce, 377 | type: 3} 378 | propertyPath: m_AnchoredPosition.y 379 | value: 0 380 | objectReference: {fileID: 0} 381 | - target: {fileID: 224528672208050248, guid: 48a3257b2fa87467d8f95a41140cd3ce, 382 | type: 3} 383 | propertyPath: m_AnchorMin.y 384 | value: 0 385 | objectReference: {fileID: 0} 386 | - target: {fileID: 224528672208050248, guid: 48a3257b2fa87467d8f95a41140cd3ce, 387 | type: 3} 388 | propertyPath: m_AnchorMax.y 389 | value: 0 390 | objectReference: {fileID: 0} 391 | - target: {fileID: 224528672208050248, guid: 48a3257b2fa87467d8f95a41140cd3ce, 392 | type: 3} 393 | propertyPath: m_AnchoredPosition.x 394 | value: 0 395 | objectReference: {fileID: 0} 396 | - target: {fileID: 224528672208050248, guid: 48a3257b2fa87467d8f95a41140cd3ce, 397 | type: 3} 398 | propertyPath: m_AnchoredPosition.y 399 | value: 0 400 | objectReference: {fileID: 0} 401 | - target: {fileID: 1919124042662507149, guid: 48a3257b2fa87467d8f95a41140cd3ce, 402 | type: 3} 403 | propertyPath: m_AnchorMin.y 404 | value: 0 405 | objectReference: {fileID: 0} 406 | - target: {fileID: 1919124042662507149, guid: 48a3257b2fa87467d8f95a41140cd3ce, 407 | type: 3} 408 | propertyPath: m_AnchorMax.y 409 | value: 0 410 | objectReference: {fileID: 0} 411 | - target: {fileID: 1919124042662507149, guid: 48a3257b2fa87467d8f95a41140cd3ce, 412 | type: 3} 413 | propertyPath: m_AnchoredPosition.x 414 | value: 0 415 | objectReference: {fileID: 0} 416 | - target: {fileID: 1919124042662507149, guid: 48a3257b2fa87467d8f95a41140cd3ce, 417 | type: 3} 418 | propertyPath: m_AnchoredPosition.y 419 | value: 0 420 | objectReference: {fileID: 0} 421 | - target: {fileID: 2106048171253168516, guid: 48a3257b2fa87467d8f95a41140cd3ce, 422 | type: 3} 423 | propertyPath: m_AnchorMin.y 424 | value: 0 425 | objectReference: {fileID: 0} 426 | - target: {fileID: 2106048171253168516, guid: 48a3257b2fa87467d8f95a41140cd3ce, 427 | type: 3} 428 | propertyPath: m_AnchorMax.y 429 | value: 0 430 | objectReference: {fileID: 0} 431 | - target: {fileID: 2106048171253168516, guid: 48a3257b2fa87467d8f95a41140cd3ce, 432 | type: 3} 433 | propertyPath: m_AnchoredPosition.x 434 | value: 0 435 | objectReference: {fileID: 0} 436 | - target: {fileID: 2106048171253168516, guid: 48a3257b2fa87467d8f95a41140cd3ce, 437 | type: 3} 438 | propertyPath: m_AnchoredPosition.y 439 | value: 0 440 | objectReference: {fileID: 0} 441 | - target: {fileID: 3822296998695286236, guid: 48a3257b2fa87467d8f95a41140cd3ce, 442 | type: 3} 443 | propertyPath: m_AnchoredPosition.x 444 | value: 512 445 | objectReference: {fileID: 0} 446 | - target: {fileID: 3822296998695286236, guid: 48a3257b2fa87467d8f95a41140cd3ce, 447 | type: 3} 448 | propertyPath: m_AnchorMin.y 449 | value: 0 450 | objectReference: {fileID: 0} 451 | - target: {fileID: 3822296998695286236, guid: 48a3257b2fa87467d8f95a41140cd3ce, 452 | type: 3} 453 | propertyPath: m_AnchorMax.y 454 | value: 0 455 | objectReference: {fileID: 0} 456 | - target: {fileID: 3822296998695286236, guid: 48a3257b2fa87467d8f95a41140cd3ce, 457 | type: 3} 458 | propertyPath: m_AnchoredPosition.y 459 | value: 0 460 | objectReference: {fileID: 0} 461 | - target: {fileID: 3822296998695286236, guid: 48a3257b2fa87467d8f95a41140cd3ce, 462 | type: 3} 463 | propertyPath: m_SizeDelta.x 464 | value: 0 465 | objectReference: {fileID: 0} 466 | - target: {fileID: 3822296998695286236, guid: 48a3257b2fa87467d8f95a41140cd3ce, 467 | type: 3} 468 | propertyPath: m_SizeDelta.y 469 | value: 0 470 | objectReference: {fileID: 0} 471 | - target: {fileID: 6087068503683214428, guid: 48a3257b2fa87467d8f95a41140cd3ce, 472 | type: 3} 473 | propertyPath: m_AnchorMin.y 474 | value: 0 475 | objectReference: {fileID: 0} 476 | - target: {fileID: 6087068503683214428, guid: 48a3257b2fa87467d8f95a41140cd3ce, 477 | type: 3} 478 | propertyPath: m_AnchorMax.y 479 | value: 0 480 | objectReference: {fileID: 0} 481 | - target: {fileID: 6087068503683214428, guid: 48a3257b2fa87467d8f95a41140cd3ce, 482 | type: 3} 483 | propertyPath: m_AnchoredPosition.x 484 | value: 0 485 | objectReference: {fileID: 0} 486 | - target: {fileID: 6087068503683214428, guid: 48a3257b2fa87467d8f95a41140cd3ce, 487 | type: 3} 488 | propertyPath: m_AnchoredPosition.y 489 | value: 0 490 | objectReference: {fileID: 0} 491 | - target: {fileID: 7636310937544795877, guid: 48a3257b2fa87467d8f95a41140cd3ce, 492 | type: 3} 493 | propertyPath: m_AnchorMin.y 494 | value: 0 495 | objectReference: {fileID: 0} 496 | - target: {fileID: 7636310937544795877, guid: 48a3257b2fa87467d8f95a41140cd3ce, 497 | type: 3} 498 | propertyPath: m_AnchorMax.y 499 | value: 0 500 | objectReference: {fileID: 0} 501 | - target: {fileID: 7636310937544795877, guid: 48a3257b2fa87467d8f95a41140cd3ce, 502 | type: 3} 503 | propertyPath: m_AnchoredPosition.x 504 | value: 0 505 | objectReference: {fileID: 0} 506 | - target: {fileID: 7636310937544795877, guid: 48a3257b2fa87467d8f95a41140cd3ce, 507 | type: 3} 508 | propertyPath: m_AnchoredPosition.y 509 | value: 0 510 | objectReference: {fileID: 0} 511 | m_RemovedComponents: [] 512 | m_SourcePrefab: {fileID: 100100000, guid: 48a3257b2fa87467d8f95a41140cd3ce, type: 3} 513 | --- !u!224 &1693025268 stripped 514 | RectTransform: 515 | m_CorrespondingSourceObject: {fileID: 224204867781484398, guid: 48a3257b2fa87467d8f95a41140cd3ce, 516 | type: 3} 517 | m_PrefabInstance: {fileID: 1367319694} 518 | m_PrefabAsset: {fileID: 0} 519 | --- !u!1 &1980279638 520 | GameObject: 521 | m_ObjectHideFlags: 0 522 | m_CorrespondingSourceObject: {fileID: 0} 523 | m_PrefabInstance: {fileID: 0} 524 | m_PrefabAsset: {fileID: 0} 525 | serializedVersion: 6 526 | m_Component: 527 | - component: {fileID: 1980279642} 528 | - component: {fileID: 1980279641} 529 | - component: {fileID: 1980279640} 530 | - component: {fileID: 1980279639} 531 | m_Layer: 5 532 | m_Name: Canvas 533 | m_TagString: Untagged 534 | m_Icon: {fileID: 0} 535 | m_NavMeshLayer: 0 536 | m_StaticEditorFlags: 0 537 | m_IsActive: 1 538 | --- !u!114 &1980279639 539 | MonoBehaviour: 540 | m_ObjectHideFlags: 0 541 | m_CorrespondingSourceObject: {fileID: 0} 542 | m_PrefabInstance: {fileID: 0} 543 | m_PrefabAsset: {fileID: 0} 544 | m_GameObject: {fileID: 1980279638} 545 | m_Enabled: 1 546 | m_EditorHideFlags: 0 547 | m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} 548 | m_Name: 549 | m_EditorClassIdentifier: 550 | m_IgnoreReversedGraphics: 1 551 | m_BlockingObjects: 0 552 | m_BlockingMask: 553 | serializedVersion: 2 554 | m_Bits: 4294967295 555 | --- !u!114 &1980279640 556 | MonoBehaviour: 557 | m_ObjectHideFlags: 0 558 | m_CorrespondingSourceObject: {fileID: 0} 559 | m_PrefabInstance: {fileID: 0} 560 | m_PrefabAsset: {fileID: 0} 561 | m_GameObject: {fileID: 1980279638} 562 | m_Enabled: 1 563 | m_EditorHideFlags: 0 564 | m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} 565 | m_Name: 566 | m_EditorClassIdentifier: 567 | m_UiScaleMode: 0 568 | m_ReferencePixelsPerUnit: 100 569 | m_ScaleFactor: 2 570 | m_ReferenceResolution: {x: 800, y: 600} 571 | m_ScreenMatchMode: 0 572 | m_MatchWidthOrHeight: 0 573 | m_PhysicalUnit: 3 574 | m_FallbackScreenDPI: 96 575 | m_DefaultSpriteDPI: 96 576 | m_DynamicPixelsPerUnit: 1 577 | --- !u!223 &1980279641 578 | Canvas: 579 | m_ObjectHideFlags: 0 580 | m_CorrespondingSourceObject: {fileID: 0} 581 | m_PrefabInstance: {fileID: 0} 582 | m_PrefabAsset: {fileID: 0} 583 | m_GameObject: {fileID: 1980279638} 584 | m_Enabled: 1 585 | serializedVersion: 3 586 | m_RenderMode: 0 587 | m_Camera: {fileID: 876042630} 588 | m_PlaneDistance: 5 589 | m_PixelPerfect: 1 590 | m_ReceivesEvents: 1 591 | m_OverrideSorting: 0 592 | m_OverridePixelPerfect: 0 593 | m_SortingBucketNormalizedSize: 0 594 | m_AdditionalShaderChannelsFlag: 25 595 | m_SortingLayerID: 0 596 | m_SortingOrder: 0 597 | m_TargetDisplay: 0 598 | --- !u!224 &1980279642 599 | RectTransform: 600 | m_ObjectHideFlags: 0 601 | m_CorrespondingSourceObject: {fileID: 0} 602 | m_PrefabInstance: {fileID: 0} 603 | m_PrefabAsset: {fileID: 0} 604 | m_GameObject: {fileID: 1980279638} 605 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 606 | m_LocalPosition: {x: 0, y: 0, z: 0} 607 | m_LocalScale: {x: 0, y: 0, z: 0} 608 | m_Children: 609 | - {fileID: 1693025268} 610 | m_Father: {fileID: 0} 611 | m_RootOrder: 1 612 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 613 | m_AnchorMin: {x: 0, y: 0} 614 | m_AnchorMax: {x: 0, y: 0} 615 | m_AnchoredPosition: {x: 0, y: 0} 616 | m_SizeDelta: {x: 0, y: 0} 617 | m_Pivot: {x: 0, y: 0} 618 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Inventory Overlay.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c60b45d6939fb4b7cbc4619eb492024c 3 | timeCreated: 1481784028 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Inventory World Space.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98c6d58fcc520439bba8bad4763f9e43 3 | timeCreated: 1481784028 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/InventoryProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace FarrokhGames.Inventory.Examples 5 | { 6 | public class InventoryProvider : IInventoryProvider 7 | { 8 | private List _items = new List(); 9 | private int _maximumAlowedItemCount; 10 | ItemType _allowedItem; 11 | 12 | /// 13 | /// CTOR 14 | /// 15 | public InventoryProvider(InventoryRenderMode renderMode, int maximumAlowedItemCount = -1, ItemType allowedItem = ItemType.Any) 16 | { 17 | inventoryRenderMode = renderMode; 18 | _maximumAlowedItemCount = maximumAlowedItemCount; 19 | _allowedItem = allowedItem; 20 | } 21 | 22 | public int inventoryItemCount => _items.Count; 23 | 24 | public InventoryRenderMode inventoryRenderMode { get; private set; } 25 | 26 | public bool isInventoryFull 27 | { 28 | get 29 | { 30 | if (_maximumAlowedItemCount < 0)return false; 31 | return inventoryItemCount >= _maximumAlowedItemCount; 32 | } 33 | } 34 | 35 | public bool AddInventoryItem(IInventoryItem item) 36 | { 37 | if (!_items.Contains(item)) 38 | { 39 | _items.Add(item); 40 | return true; 41 | } 42 | return false; 43 | } 44 | 45 | public bool DropInventoryItem(IInventoryItem item) 46 | { 47 | return RemoveInventoryItem(item); 48 | } 49 | 50 | public IInventoryItem GetInventoryItem(int index) 51 | { 52 | return _items[index]; 53 | } 54 | 55 | public bool CanAddInventoryItem(IInventoryItem item) 56 | { 57 | if (_allowedItem == ItemType.Any)return true; 58 | return (item as ItemDefinition).Type == _allowedItem; 59 | } 60 | 61 | public bool CanRemoveInventoryItem(IInventoryItem item) 62 | { 63 | return true; 64 | } 65 | 66 | public bool CanDropInventoryItem(IInventoryItem item) 67 | { 68 | return true; 69 | } 70 | 71 | public bool RemoveInventoryItem(IInventoryItem item) 72 | { 73 | return _items.Remove(item); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /Unity Project/Assets/Example/InventoryProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab14f5f43932a4e51b5139145e6a75d2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/InventorySelection.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace FarrokhGames.Inventory.Examples 5 | { 6 | public class InventorySelection : MonoBehaviour 7 | { 8 | Text _text; 9 | 10 | void Start() 11 | { 12 | _text = GetComponentInChildren(); 13 | _text.text = string.Empty; 14 | 15 | var allControllers = GameObject.FindObjectsOfType(); 16 | 17 | foreach (var controller in allControllers) 18 | { 19 | controller.onItemHovered += HandleItemHover; 20 | } 21 | } 22 | 23 | private void HandleItemHover(IInventoryItem item) 24 | { 25 | if (item != null) 26 | { 27 | _text.text = (item as ItemDefinition).Name; 28 | } 29 | else 30 | { 31 | _text.text = string.Empty; 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Unity Project/Assets/Example/InventorySelection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd50d1063f39b42d8a9f2a20aa610fa3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/ItemDefinition.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace FarrokhGames.Inventory.Examples 4 | { 5 | /// 6 | /// Scriptable Object representing an Inventory Item 7 | /// 8 | [CreateAssetMenu(fileName = "Item", menuName = "Inventory/Item", order = 1)] 9 | public class ItemDefinition : ScriptableObject, IInventoryItem 10 | { 11 | [SerializeField] private Sprite _sprite = null; 12 | [SerializeField] private InventoryShape _shape = null; 13 | [SerializeField] private ItemType _type = ItemType.Utility; 14 | [SerializeField] private bool _canDrop = true; 15 | [SerializeField, HideInInspector] private Vector2Int _position = Vector2Int.zero; 16 | 17 | /// 18 | /// The name of the item 19 | /// 20 | public string Name => this.name; 21 | 22 | /// 23 | /// The type of the item 24 | /// 25 | public ItemType Type => _type; 26 | 27 | /// 28 | public Sprite sprite => _sprite; 29 | 30 | /// 31 | public int width => _shape.width; 32 | 33 | /// 34 | public int height => _shape.height; 35 | 36 | /// 37 | public Vector2Int position 38 | { 39 | get => _position; 40 | set => _position = value; 41 | } 42 | 43 | /// 44 | public bool IsPartOfShape(Vector2Int localPosition) 45 | { 46 | return _shape.IsPartOfShape(localPosition); 47 | } 48 | 49 | /// 50 | public bool canDrop => _canDrop; 51 | 52 | /// 53 | /// Creates a copy if this scriptable object 54 | /// 55 | public IInventoryItem CreateInstance() 56 | { 57 | var clone = ScriptableObject.Instantiate(this); 58 | clone.name = clone.name.Substring(0, clone.name.Length - 7); // Remove (Clone) from name 59 | return clone; 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Unity Project/Assets/Example/ItemDefinition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92e9099dba1c24dcda700fa19b64a47b 3 | timeCreated: 1509648015 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/ItemTypes.cs: -------------------------------------------------------------------------------- 1 | namespace FarrokhGames.Inventory.Examples 2 | { 3 | public enum ItemType 4 | { 5 | Any, 6 | Weapons, 7 | Utility, 8 | } 9 | } -------------------------------------------------------------------------------- /Unity Project/Assets/Example/ItemTypes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2fb5a542a2a442c0851167a1577acf7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 317cfa3cf9a8645d78d28a356fc889dc 3 | folderAsset: yes 4 | timeCreated: 1481841553 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Dagger.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 92e9099dba1c24dcda700fa19b64a47b, type: 3} 13 | m_Name: Dagger 14 | m_EditorClassIdentifier: 15 | _sprite: {fileID: 21300002, guid: 4f666dd4618814d2f8c5a2599cd224c7, type: 3} 16 | _shape: 17 | _width: 2 18 | _height: 1 19 | _shape: 0101 20 | _type: 1 21 | _position: {x: 0, y: 0} 22 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Dagger.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53fac397599b9450cb6ffc84b6990844 3 | timeCreated: 1509649710 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Gadget.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 92e9099dba1c24dcda700fa19b64a47b, type: 3} 12 | m_Name: Gadget 13 | m_EditorClassIdentifier: 14 | _sprite: {fileID: 21300008, guid: 4f666dd4618814d2f8c5a2599cd224c7, type: 3} 15 | _shape: 16 | _width: 1 17 | _height: 2 18 | _shape: 0101 19 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Gadget.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a790d8ff8de79447eba65a1c9f328eb1 3 | timeCreated: 1509649710 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Green Vial.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 92e9099dba1c24dcda700fa19b64a47b, type: 3} 12 | m_Name: Green Vial 13 | m_EditorClassIdentifier: 14 | _sprite: {fileID: 21300018, guid: 4f666dd4618814d2f8c5a2599cd224c7, type: 3} 15 | _shape: 16 | _width: 1 17 | _height: 1 18 | _shape: 01 19 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Green Vial.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e71a40542e224abcb0957010541b8c8 3 | timeCreated: 1509649710 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Ray Gun.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 92e9099dba1c24dcda700fa19b64a47b, type: 3} 13 | m_Name: Ray Gun 14 | m_EditorClassIdentifier: 15 | _sprite: {fileID: 21300000, guid: 4f666dd4618814d2f8c5a2599cd224c7, type: 3} 16 | _shape: 17 | _width: 2 18 | _height: 2 19 | _shape: 01010001 20 | _type: 1 21 | _canDrop: 0 22 | _position: {x: 0, y: 0} 23 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Ray Gun.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2103fea2b7f614248bd4e2271871cbf9 3 | timeCreated: 1509649710 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Red Vial.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 92e9099dba1c24dcda700fa19b64a47b, type: 3} 12 | m_Name: Red Vial 13 | m_EditorClassIdentifier: 14 | _sprite: {fileID: 21300006, guid: 4f666dd4618814d2f8c5a2599cd224c7, type: 3} 15 | _shape: 16 | _width: 1 17 | _height: 1 18 | _shape: 01 19 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Red Vial.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 640085f25f2394070afe43c1edd4b92e 3 | timeCreated: 1509649710 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Stun Baton.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 92e9099dba1c24dcda700fa19b64a47b, type: 3} 13 | m_Name: Stun Baton 14 | m_EditorClassIdentifier: 15 | _sprite: {fileID: 21300004, guid: 4f666dd4618814d2f8c5a2599cd224c7, type: 3} 16 | _shape: 17 | _width: 1 18 | _height: 4 19 | _shape: 01010101 20 | _type: 1 21 | _position: {x: 0, y: 0} 22 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/Items/Stun Baton.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57a0e4d113f3d48eeb460a17da5183e4 3 | timeCreated: 1509649710 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/SizeInventoryExample.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace FarrokhGames.Inventory.Examples 4 | { 5 | /// 6 | /// Example Lobby class 7 | /// 8 | [RequireComponent(typeof(InventoryRenderer))] 9 | public class SizeInventoryExample : MonoBehaviour 10 | { 11 | [SerializeField] private InventoryRenderMode _renderMode = InventoryRenderMode.Grid; 12 | [SerializeField] private int _maximumAlowedItemCount = -1; 13 | [SerializeField] private ItemType _allowedItem = ItemType.Any; 14 | [SerializeField] private int _width = 8; 15 | [SerializeField] private int _height = 4; 16 | [SerializeField] private ItemDefinition[] _definitions = null; 17 | [SerializeField] private bool _fillRandomly = true; // Should the inventory get filled with random items? 18 | [SerializeField] private bool _fillEmpty = false; // Should the inventory get completely filled? 19 | 20 | void Start() 21 | { 22 | var provider = new InventoryProvider(_renderMode, _maximumAlowedItemCount, _allowedItem); 23 | 24 | // Create inventory 25 | var inventory = new InventoryManager(provider, _width, _height); 26 | 27 | // Fill inventory with random items 28 | if (_fillRandomly) 29 | { 30 | var tries = (_width * _height) / 3; 31 | for (var i = 0; i < tries; i++) 32 | { 33 | inventory.TryAdd(_definitions[Random.Range(0, _definitions.Length)].CreateInstance()); 34 | } 35 | } 36 | 37 | // Fill empty slots with first (1x1) item 38 | if (_fillEmpty) 39 | { 40 | for (var i = 0; i < _width * _height; i++) 41 | { 42 | inventory.TryAdd(_definitions[0].CreateInstance()); 43 | } 44 | } 45 | 46 | // Sets the renderers's inventory to trigger drawing 47 | GetComponent().SetInventory(inventory, provider.inventoryRenderMode); 48 | 49 | // Log items being dropped on the ground 50 | inventory.onItemDropped += (item) => 51 | { 52 | Debug.Log((item as ItemDefinition).Name + " was dropped on the ground"); 53 | }; 54 | 55 | // Log when an item was unable to be placed on the ground (due to its canDrop being set to false) 56 | inventory.onItemDroppedFailed += (item) => 57 | { 58 | Debug.Log($"You're not allowed to drop {(item as ItemDefinition).Name} on the ground"); 59 | }; 60 | 61 | // Log when an item was unable to be placed on the ground (due to its canDrop being set to false) 62 | inventory.onItemAddedFailed += (item) => 63 | { 64 | Debug.Log($"You can't put {(item as ItemDefinition).Name} there!"); 65 | }; 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Unity Project/Assets/Example/SizeInventoryExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cf862b43efc1409fa7d9796bfdd0f84 3 | timeCreated: 1481785221 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity Project/Assets/Example/inventory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarrokhGames/Inventory/174f55d1d03cc9742c367020c491fd03508834a9/Unity Project/Assets/Example/inventory.png -------------------------------------------------------------------------------- /Unity Project/Assets/Example/inventory.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f666dd4618814d2f8c5a2599cd224c7 3 | TextureImporter: 4 | internalIDToNameTable: 5 | - first: 6 | 213: 21300000 7 | second: raygun 8 | - first: 9 | 213: 21300002 10 | second: dagger 11 | - first: 12 | 213: 21300004 13 | second: stunbaton 14 | - first: 15 | 213: 21300006 16 | second: vial_red 17 | - first: 18 | 213: 21300008 19 | second: gadget 20 | - first: 21 | 213: 21300010 22 | second: inventory_border 23 | - first: 24 | 213: 21300012 25 | second: inventory_cell_empty 26 | - first: 27 | 213: 21300014 28 | second: inventory_cell_selected 29 | - first: 30 | 213: 21300016 31 | second: inventory_cell_blocked 32 | - first: 33 | 213: 21300018 34 | second: vial_green 35 | externalObjects: {} 36 | serializedVersion: 10 37 | mipmaps: 38 | mipMapMode: 0 39 | enableMipMap: 0 40 | sRGBTexture: 0 41 | linearTexture: 0 42 | fadeOut: 0 43 | borderMipMap: 0 44 | mipMapsPreserveCoverage: 0 45 | alphaTestReferenceValue: 0.5 46 | mipMapFadeDistanceStart: 1 47 | mipMapFadeDistanceEnd: 3 48 | bumpmap: 49 | convertToNormalMap: 0 50 | externalNormalMap: 0 51 | heightScale: 0.25 52 | normalMapFilter: 0 53 | isReadable: 0 54 | streamingMipmaps: 0 55 | streamingMipmapsPriority: 0 56 | grayScaleToAlpha: 0 57 | generateCubemap: 6 58 | cubemapConvolution: 0 59 | seamlessCubemap: 0 60 | textureFormat: 1 61 | maxTextureSize: 2048 62 | textureSettings: 63 | serializedVersion: 2 64 | filterMode: 0 65 | aniso: -1 66 | mipBias: -100 67 | wrapU: 1 68 | wrapV: 1 69 | wrapW: 1 70 | nPOTScale: 0 71 | lightmap: 0 72 | compressionQuality: 50 73 | spriteMode: 2 74 | spriteExtrude: 1 75 | spriteMeshType: 1 76 | alignment: 0 77 | spritePivot: {x: 0.5, y: 0.5} 78 | spritePixelsToUnits: 100 79 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 80 | spriteGenerateFallbackPhysicsShape: 1 81 | alphaUsage: 1 82 | alphaIsTransparency: 1 83 | spriteTessellationDetail: -1 84 | textureType: 8 85 | textureShape: 1 86 | singleChannelComponent: 0 87 | maxTextureSizeSet: 0 88 | compressionQualitySet: 0 89 | textureFormatSet: 0 90 | platformSettings: 91 | - serializedVersion: 3 92 | buildTarget: DefaultTexturePlatform 93 | maxTextureSize: 2048 94 | resizeAlgorithm: 0 95 | textureFormat: -1 96 | textureCompression: 0 97 | compressionQuality: 50 98 | crunchedCompression: 0 99 | allowsAlphaSplitting: 0 100 | overridden: 0 101 | androidETC2FallbackOverride: 0 102 | forceMaximumCompressionQuality_BC6H_BC7: 1 103 | - serializedVersion: 3 104 | buildTarget: Standalone 105 | maxTextureSize: 2048 106 | resizeAlgorithm: 0 107 | textureFormat: -1 108 | textureCompression: 0 109 | compressionQuality: 50 110 | crunchedCompression: 0 111 | allowsAlphaSplitting: 0 112 | overridden: 0 113 | androidETC2FallbackOverride: 0 114 | forceMaximumCompressionQuality_BC6H_BC7: 1 115 | - serializedVersion: 3 116 | buildTarget: iPhone 117 | maxTextureSize: 2048 118 | resizeAlgorithm: 0 119 | textureFormat: -1 120 | textureCompression: 0 121 | compressionQuality: 50 122 | crunchedCompression: 0 123 | allowsAlphaSplitting: 0 124 | overridden: 0 125 | androidETC2FallbackOverride: 0 126 | forceMaximumCompressionQuality_BC6H_BC7: 1 127 | - serializedVersion: 3 128 | buildTarget: Android 129 | maxTextureSize: 2048 130 | resizeAlgorithm: 0 131 | textureFormat: -1 132 | textureCompression: 0 133 | compressionQuality: 50 134 | crunchedCompression: 0 135 | allowsAlphaSplitting: 0 136 | overridden: 0 137 | androidETC2FallbackOverride: 0 138 | forceMaximumCompressionQuality_BC6H_BC7: 1 139 | - serializedVersion: 3 140 | buildTarget: WebGL 141 | maxTextureSize: 2048 142 | resizeAlgorithm: 0 143 | textureFormat: -1 144 | textureCompression: 0 145 | compressionQuality: 50 146 | crunchedCompression: 0 147 | allowsAlphaSplitting: 0 148 | overridden: 0 149 | androidETC2FallbackOverride: 0 150 | forceMaximumCompressionQuality_BC6H_BC7: 1 151 | spriteSheet: 152 | serializedVersion: 2 153 | sprites: 154 | - serializedVersion: 2 155 | name: raygun 156 | rect: 157 | serializedVersion: 2 158 | x: 0 159 | y: 64 160 | width: 64 161 | height: 64 162 | alignment: 0 163 | pivot: {x: 0.5, y: 0.5} 164 | border: {x: 0, y: 0, z: 0, w: 0} 165 | outline: [] 166 | physicsShape: [] 167 | tessellationDetail: 0 168 | bones: [] 169 | spriteID: 02305410000000000800000000000000 170 | internalID: 21300000 171 | vertices: [] 172 | indices: 173 | edges: [] 174 | weights: [] 175 | - serializedVersion: 2 176 | name: dagger 177 | rect: 178 | serializedVersion: 2 179 | x: 0 180 | y: 32 181 | width: 64 182 | height: 32 183 | alignment: 0 184 | pivot: {x: 0.5, y: 0.5} 185 | border: {x: 0, y: 0, z: 0, w: 0} 186 | outline: [] 187 | physicsShape: [] 188 | tessellationDetail: 0 189 | bones: [] 190 | spriteID: 22305410000000000800000000000000 191 | internalID: 21300002 192 | vertices: [] 193 | indices: 194 | edges: [] 195 | weights: [] 196 | - serializedVersion: 2 197 | name: stunbaton 198 | rect: 199 | serializedVersion: 2 200 | x: 64 201 | y: 0 202 | width: 32 203 | height: 128 204 | alignment: 0 205 | pivot: {x: 0.5, y: 0.5} 206 | border: {x: 0, y: 0, z: 0, w: 0} 207 | outline: [] 208 | physicsShape: [] 209 | tessellationDetail: 0 210 | bones: [] 211 | spriteID: 42305410000000000800000000000000 212 | internalID: 21300004 213 | vertices: [] 214 | indices: 215 | edges: [] 216 | weights: [] 217 | - serializedVersion: 2 218 | name: vial_red 219 | rect: 220 | serializedVersion: 2 221 | x: 96 222 | y: 96 223 | width: 32 224 | height: 32 225 | alignment: 0 226 | pivot: {x: 0.5, y: 0.5} 227 | border: {x: 0, y: 0, z: 0, w: 0} 228 | outline: [] 229 | physicsShape: [] 230 | tessellationDetail: 0 231 | bones: [] 232 | spriteID: 62305410000000000800000000000000 233 | internalID: 21300006 234 | vertices: [] 235 | indices: 236 | edges: [] 237 | weights: [] 238 | - serializedVersion: 2 239 | name: gadget 240 | rect: 241 | serializedVersion: 2 242 | x: 96 243 | y: 0 244 | width: 32 245 | height: 64 246 | alignment: 0 247 | pivot: {x: 0.5, y: 0.5} 248 | border: {x: 0, y: 0, z: 0, w: 0} 249 | outline: [] 250 | physicsShape: [] 251 | tessellationDetail: 0 252 | bones: [] 253 | spriteID: 82305410000000000800000000000000 254 | internalID: 21300008 255 | vertices: [] 256 | indices: 257 | edges: [] 258 | weights: [] 259 | - serializedVersion: 2 260 | name: inventory_border 261 | rect: 262 | serializedVersion: 2 263 | x: 96 264 | y: 64 265 | width: 32 266 | height: 32 267 | alignment: 0 268 | pivot: {x: 0.5, y: 0.5} 269 | border: {x: 14, y: 14, z: 14, w: 14} 270 | outline: [] 271 | physicsShape: [] 272 | tessellationDetail: 0 273 | bones: [] 274 | spriteID: a2305410000000000800000000000000 275 | internalID: 21300010 276 | vertices: [] 277 | indices: 278 | edges: [] 279 | weights: [] 280 | - serializedVersion: 2 281 | name: inventory_cell_empty 282 | rect: 283 | serializedVersion: 2 284 | x: 0 285 | y: 16 286 | width: 16 287 | height: 16 288 | alignment: 0 289 | pivot: {x: 0.5, y: 0.5} 290 | border: {x: 8, y: 8, z: 8, w: 8} 291 | outline: [] 292 | physicsShape: [] 293 | tessellationDetail: 0 294 | bones: [] 295 | spriteID: c2305410000000000800000000000000 296 | internalID: 21300012 297 | vertices: [] 298 | indices: 299 | edges: [] 300 | weights: [] 301 | - serializedVersion: 2 302 | name: inventory_cell_selected 303 | rect: 304 | serializedVersion: 2 305 | x: 16 306 | y: 16 307 | width: 16 308 | height: 16 309 | alignment: 0 310 | pivot: {x: 0.5, y: 0.5} 311 | border: {x: 8, y: 8, z: 8, w: 8} 312 | outline: [] 313 | physicsShape: [] 314 | tessellationDetail: 0 315 | bones: [] 316 | spriteID: e2305410000000000800000000000000 317 | internalID: 21300014 318 | vertices: [] 319 | indices: 320 | edges: [] 321 | weights: [] 322 | - serializedVersion: 2 323 | name: inventory_cell_blocked 324 | rect: 325 | serializedVersion: 2 326 | x: 16 327 | y: 0 328 | width: 16 329 | height: 16 330 | alignment: 0 331 | pivot: {x: 0.5, y: 0.5} 332 | border: {x: 8, y: 8, z: 8, w: 8} 333 | outline: [] 334 | physicsShape: [] 335 | tessellationDetail: 0 336 | bones: [] 337 | spriteID: 03305410000000000800000000000000 338 | internalID: 21300016 339 | vertices: [] 340 | indices: 341 | edges: [] 342 | weights: [] 343 | - serializedVersion: 2 344 | name: vial_green 345 | rect: 346 | serializedVersion: 2 347 | x: 32 348 | y: 0 349 | width: 32 350 | height: 32 351 | alignment: 0 352 | pivot: {x: 0, y: 0} 353 | border: {x: 0, y: 0, z: 0, w: 0} 354 | outline: [] 355 | physicsShape: [] 356 | tessellationDetail: 0 357 | bones: [] 358 | spriteID: 23305410000000000800000000000000 359 | internalID: 21300018 360 | vertices: [] 361 | indices: 362 | edges: [] 363 | weights: [] 364 | outline: [] 365 | physicsShape: [] 366 | bones: [] 367 | spriteID: 368 | internalID: 0 369 | vertices: [] 370 | indices: 371 | edges: [] 372 | weights: [] 373 | secondaryTextures: [] 374 | spritePackingTag: 375 | pSDRemoveMatte: 0 376 | pSDShowRemoveMatteOption: 0 377 | userData: 378 | assetBundleName: 379 | assetBundleVariant: 380 | -------------------------------------------------------------------------------- /Unity Project/Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Mon Jun 24 19:31:05 2019 3 | 4 | Packages were changed. 5 | Update Mode: updateDependencies 6 | 7 | The following packages were added: 8 | com.unity.collab-proxy@1.2.16 9 | com.unity.timeline@1.0.0 10 | com.unity.multiplayer-hlapi@1.0.2 11 | com.unity.xr.legacyinputhelpers@2.0.2 12 | The following packages were updated: 13 | com.unity.analytics from version 2.0.16 to 3.3.2 14 | com.unity.package-manager-ui from version 1.9.11 to 2.1.2 15 | com.unity.purchasing from version 2.0.3 to 2.0.6 16 | com.unity.textmeshpro from version 1.2.4 to 2.0.1 17 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc7e678b03e1d4cf9b3b1e214ddf4d3a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Editor/Farrokhgames.Inventory.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Farrokhgames.Inventory.Editor", 3 | "references": [ 4 | "Farrokhgames.Inventory" 5 | ], 6 | "includePlatforms": [ 7 | "Editor" 8 | ], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Editor/Farrokhgames.Inventory.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 739aa9972c5754b509c67021e4189c24 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Editor/InventoryShapePropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace FarrokhGames.Inventory 5 | { 6 | /// 7 | /// Custom Property Drawer for InventoryShape 8 | /// 9 | [CustomPropertyDrawer(typeof(InventoryShape))] 10 | public class InventoryShapePropertyDrawer : PropertyDrawer 11 | { 12 | const int GridSize = 16; // The size between the boold-fields that make up the shape matrix 13 | 14 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 15 | { 16 | // Find properties 17 | var pWidth = property.FindPropertyRelative("_width"); 18 | var pHeight = property.FindPropertyRelative("_height"); 19 | var pShape = property.FindPropertyRelative("_shape"); 20 | 21 | // Clamp height & width 22 | if (pWidth.intValue <= 0) { pWidth.intValue = 1; } 23 | if (pHeight.intValue <= 0) { pHeight.intValue = 1; } 24 | 25 | // Begin property 26 | EditorGUI.BeginProperty(position, label, property); 27 | 28 | // Draw label 29 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 30 | 31 | // Fix intent 32 | var indent = EditorGUI.indentLevel; 33 | EditorGUI.indentLevel = 0; 34 | 35 | // Calculate rects 36 | var halfWidth = position.width / 2; 37 | var widthRect = new Rect(position.x, position.y, halfWidth, GridSize); 38 | var heightRect = new Rect(position.x + halfWidth, position.y, halfWidth, GridSize); 39 | 40 | // Width & Height 41 | EditorGUIUtility.labelWidth = 40; 42 | EditorGUI.PropertyField(widthRect, pWidth, new GUIContent("width")); 43 | EditorGUI.PropertyField(heightRect, pHeight, new GUIContent("height")); 44 | 45 | // Draw grid 46 | var width = pWidth.intValue; 47 | var height = pHeight.intValue; 48 | pShape.arraySize = width * height; 49 | for (var x = 0; x < width; x++) 50 | { 51 | for (var y = 0; y < height; y++) 52 | { 53 | var index = x + width * y; 54 | var rect = new Rect(position.x + (x * GridSize), position.y + GridSize + (y * GridSize), GridSize, GridSize); 55 | EditorGUI.PropertyField(rect, pShape.GetArrayElementAtIndex(index), GUIContent.none); 56 | } 57 | } 58 | 59 | // Set indent back to what it was 60 | EditorGUI.indentLevel = indent; 61 | 62 | // End property 63 | EditorGUI.EndProperty(); 64 | } 65 | 66 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 67 | { 68 | float height = EditorGUI.GetPropertyHeight(property, label); 69 | height += property.FindPropertyRelative("_height").intValue * GridSize; 70 | return height; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Editor/InventoryShapePropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cc8a45534a2e4d0db5952d314a3cd9a 3 | timeCreated: 1509226575 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Farrokh Games 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. -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b93854d56d65e422da88282c2026171e 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/README.md: -------------------------------------------------------------------------------- 1 | ## A Diablo 2-style inventory system for Unity3D 2 | 3 | ## Features 4 | - ```Resize``` at runtime, dropping what no longer fits. 5 | - ```Add/Remove``` and check if an item fits from code. 6 | - ```Equipment slots``` for all your RPG needs. 7 | - ```Custom shapes``` for each item. 8 | - Rearrange items by ```draggin and dropping```, with visual feedback. 9 | - ```Move items between inventories```. 10 | - Remove items by ```dropping``` them outside the inventory. 11 | - Easily add ```custom graphics``` and change the size of your inventory. 12 | - Supports ```scaled canvases```. 13 | - Tested thoroughly with over ```75 Unit Tests```, and profiled using the Unity Profiler. 14 | - Tested using all types of ```Canvas render modes``` (Screen Space Overlay, Screen Space Camera and World Space) -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4e237ead57654fa5aa10dfc041c0b9c 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3b75cb73528143949b4e8cf6eee2019 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/Farrokhgames.Inventory.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Farrokhgames.Inventory", 3 | "references": [], 4 | "includePlatforms": [], 5 | "excludePlatforms": [], 6 | "allowUnsafeCode": false, 7 | "overrideReferences": false, 8 | "precompiledReferences": [], 9 | "autoReferenced": true, 10 | "defineConstraints": [], 11 | "versionDefines": [], 12 | "noEngineReferences": false 13 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/Farrokhgames.Inventory.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad7ca1fe27ed848b1b66decacb1f3a63 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/IInventoryItem.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace FarrokhGames.Inventory 4 | { 5 | public interface IInventoryItem 6 | { 7 | /// 8 | /// The sprite of this item 9 | /// 10 | Sprite sprite { get; } 11 | 12 | /// 13 | /// Returns this items position within an inventory 14 | /// 15 | Vector2Int position { get; set; } 16 | 17 | /// 18 | /// The width of this item 19 | /// 20 | int width { get; } 21 | 22 | /// 23 | /// The height of this item 24 | /// 25 | int height { get; } 26 | 27 | /// 28 | /// Returns true if given local position is part 29 | /// of this items shape 30 | /// 31 | bool IsPartOfShape(Vector2Int localPosition); 32 | 33 | /// 34 | /// Returns true if this item can be dropped on the ground 35 | /// 36 | bool canDrop { get; } 37 | } 38 | 39 | internal static class InventoryItemExtensions 40 | { 41 | /// 42 | /// Returns the lower left corner position of an item 43 | /// within its inventory 44 | /// 45 | internal static Vector2Int GetMinPoint(this IInventoryItem item) 46 | { 47 | return item.position; 48 | } 49 | 50 | /// 51 | /// Returns the top right corner position of an item 52 | /// within its inventory 53 | /// 54 | internal static Vector2Int GetMaxPoint(this IInventoryItem item) 55 | { 56 | return item.position + new Vector2Int(item.width, item.height); 57 | } 58 | 59 | /// 60 | /// Returns true if this item overlaps the given point within an inventory 61 | /// 62 | internal static bool Contains(this IInventoryItem item, Vector2Int inventoryPoint) 63 | { 64 | for (var iX = 0; iX < item.width; iX++) 65 | { 66 | for (var iY = 0; iY < item.height; iY++) 67 | { 68 | var iPoint = item.position + new Vector2Int(iX, iY); 69 | if (iPoint == inventoryPoint) { return true; } 70 | } 71 | } 72 | return false; 73 | } 74 | 75 | /// 76 | /// Returns true of this item overlaps a given item 77 | /// 78 | internal static bool Overlaps(this IInventoryItem item, IInventoryItem otherItem) 79 | { 80 | for (var iX = 0; iX < item.width; iX++) 81 | { 82 | for (var iY = 0; iY < item.height; iY++) 83 | { 84 | if (item.IsPartOfShape(new Vector2Int(iX, iY))) 85 | { 86 | var iPoint = item.position + new Vector2Int(iX, iY); 87 | for (var oX = 0; oX < otherItem.width; oX++) 88 | { 89 | for (var oY = 0; oY < otherItem.height; oY++) 90 | { 91 | if (otherItem.IsPartOfShape(new Vector2Int(oX, oY))) 92 | { 93 | var oPoint = otherItem.position + new Vector2Int(oX, oY); 94 | if (oPoint == iPoint) { return true; } // Hit! Items overlap 95 | } 96 | } 97 | } 98 | } 99 | } 100 | } 101 | return false; // Items does not overlap 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/IInventoryItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce535f68aff9e47a6b877edaeeb72947 3 | timeCreated: 1509652316 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/IInventoryManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace FarrokhGames.Inventory 5 | { 6 | public interface IInventoryManager : IDisposable 7 | { 8 | /// 9 | /// Invoked when an item is added to the inventory 10 | /// 11 | Action onItemAdded { get; set; } 12 | 13 | /// 14 | /// Invoked when an item was not able to be added to the inventory 15 | /// 16 | Action onItemAddedFailed { get; set; } 17 | 18 | /// 19 | /// Invoked when an item is removed to the inventory 20 | /// 21 | Action onItemRemoved { get; set; } 22 | 23 | /// 24 | /// Invoked when an item is removed from the inventory and should be placed on the ground. 25 | /// 26 | Action onItemDropped { get; set; } 27 | 28 | /// 29 | /// Invoked when an item was unable to be placed on the ground (most likely to its canDrop being set to false) 30 | /// 31 | Action onItemDroppedFailed { get; set; } 32 | 33 | /// 34 | /// Invoked when the inventory is rebuilt from scratch 35 | /// 36 | Action onRebuilt { get; set; } 37 | 38 | /// 39 | /// Invoked when the inventory changes its size 40 | /// 41 | Action onResized { get; set; } 42 | 43 | /// 44 | /// The width of the inventory 45 | /// 46 | int width { get; } 47 | 48 | /// 49 | /// The height of the inventory 50 | /// 51 | int height { get; } 52 | 53 | /// 54 | /// Sets a new width and height of the inventory 55 | /// 56 | void Resize(int width, int height); 57 | 58 | /// 59 | /// Returns all items inside this inventory 60 | /// 61 | IInventoryItem[] allItems { get; } 62 | 63 | /// 64 | /// Returns true if given item is present in this inventory 65 | /// 66 | bool Contains(IInventoryItem item); 67 | 68 | /// 69 | /// Returns true if this inventory is full 70 | /// 71 | bool isFull { get; } 72 | 73 | /// 74 | /// Returns true if its possible to add given item 75 | /// 76 | bool CanAdd(IInventoryItem item); 77 | 78 | /// 79 | /// Add given item to the inventory. Returns true 80 | /// if successful 81 | /// 82 | bool TryAdd(IInventoryItem item); 83 | 84 | /// 85 | /// Returns true if its possible to add item at location 86 | /// 87 | bool CanAddAt(IInventoryItem item, Vector2Int point); 88 | 89 | /// 90 | /// Tries to add item att location and returns true if successful 91 | /// 92 | bool TryAddAt(IInventoryItem item, Vector2Int point); 93 | 94 | /// 95 | /// Returns true if its possible to remove this item 96 | /// 97 | bool CanRemove(IInventoryItem item); 98 | 99 | /// 100 | /// Returns true ifits possible to swap this item 101 | /// 102 | bool CanSwap(IInventoryItem item); 103 | 104 | /// 105 | /// Removes given item from this inventory. Returns 106 | /// true if successful. 107 | /// 108 | bool TryRemove(IInventoryItem item); 109 | 110 | /// 111 | /// Returns true if its possible to drop this item 112 | /// 113 | bool CanDrop(IInventoryItem item); 114 | 115 | /// 116 | /// Removes an item from this inventory. Returns true 117 | /// if successful. 118 | /// 119 | bool TryDrop(IInventoryItem item); 120 | 121 | /// 122 | /// Drops all items from this inventory 123 | /// 124 | void DropAll(); 125 | 126 | /// 127 | /// Clears (destroys) all items in this inventory 128 | /// 129 | void Clear(); 130 | 131 | /// 132 | /// Rebuilds the inventory 133 | /// 134 | void Rebuild(); 135 | 136 | /// 137 | /// Get an item at given point within this inventory 138 | /// 139 | IInventoryItem GetAtPoint(Vector2Int point); 140 | 141 | /// 142 | /// Returns all items under given rectangle 143 | /// 144 | IInventoryItem[] GetAtPoint(Vector2Int point, Vector2Int size); 145 | } 146 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/IInventoryManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6fc0ef1e49924f89b245335706f132e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/IInventoryProvider.cs: -------------------------------------------------------------------------------- 1 | namespace FarrokhGames.Inventory 2 | { 3 | /// 4 | /// A provider for a single inventory 5 | /// 6 | public interface IInventoryProvider 7 | { 8 | /// 9 | /// Returns the render mode of this inventory 10 | /// 11 | InventoryRenderMode inventoryRenderMode { get; } 12 | 13 | /// 14 | /// Returns the total amount of inventory items in 15 | /// this inventory 16 | /// 17 | int inventoryItemCount { get; } 18 | 19 | /// 20 | /// Returns true if the inventory is full 21 | /// 22 | bool isInventoryFull { get; } 23 | 24 | /// 25 | /// Returns the inventory item at given index 26 | /// 27 | IInventoryItem GetInventoryItem(int index); 28 | 29 | /// 30 | /// Returns true if given inventory item is allowed inside 31 | /// this inventory 32 | /// 33 | bool CanAddInventoryItem(IInventoryItem item); 34 | 35 | /// 36 | /// Returns true if given inventory item is allowed to 37 | /// be removed from this inventory 38 | /// 39 | bool CanRemoveInventoryItem(IInventoryItem item); 40 | 41 | /// 42 | /// Returns true if given inventory item is allowed to 43 | /// be dropped on the ground 44 | /// 45 | bool CanDropInventoryItem(IInventoryItem item); 46 | 47 | /// 48 | /// Invoked when an inventory item is added to the 49 | /// inventory. Returns true if successful. 50 | /// 51 | bool AddInventoryItem(IInventoryItem item); 52 | 53 | /// 54 | /// Invoked when an inventory item is removed to the 55 | /// inventory. Returns true if successful. 56 | /// 57 | bool RemoveInventoryItem(IInventoryItem item); 58 | 59 | /// 60 | /// Invoked when an inventory item is removed from the 61 | /// inventory and should be placed on the ground. 62 | /// Returns true if successful. 63 | /// 64 | bool DropInventoryItem(IInventoryItem item); 65 | } 66 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/IInventoryProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 375396e56963d47b99bb5885a1d12553 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace FarrokhGames.Inventory 6 | { 7 | public interface IInventoryController 8 | { 9 | Action onItemHovered { get; set; } 10 | Action onItemPickedUp { get; set; } 11 | Action onItemAdded { get; set; } 12 | Action onItemSwapped { get; set; } 13 | Action onItemReturned { get; set; } 14 | Action onItemDropped { get; set; } 15 | } 16 | 17 | /// 18 | /// Enables human interaction with an inventory renderer using Unity's event systems 19 | /// 20 | [RequireComponent(typeof(InventoryRenderer))] 21 | public class InventoryController : MonoBehaviour, 22 | IPointerDownHandler, IBeginDragHandler, IDragHandler, 23 | IEndDragHandler, IPointerExitHandler, IPointerEnterHandler, 24 | IInventoryController 25 | { 26 | // The dragged item is static and shared by all controllers 27 | // This way items can be moved between controllers easily 28 | private static InventoryDraggedItem _draggedItem; 29 | 30 | /// 31 | public Action onItemHovered { get; set; } 32 | 33 | /// 34 | public Action onItemPickedUp { get; set; } 35 | 36 | /// 37 | public Action onItemAdded { get; set; } 38 | 39 | /// 40 | public Action onItemSwapped { get; set; } 41 | 42 | /// 43 | public Action onItemReturned { get; set; } 44 | 45 | /// 46 | public Action onItemDropped { get; set; } 47 | 48 | private Canvas _canvas; 49 | internal InventoryRenderer inventoryRenderer; 50 | internal InventoryManager inventory => (InventoryManager) inventoryRenderer.inventory; 51 | 52 | private IInventoryItem _itemToDrag; 53 | private PointerEventData _currentEventData; 54 | private IInventoryItem _lastHoveredItem; 55 | 56 | /* 57 | * Setup 58 | */ 59 | void Awake() 60 | { 61 | inventoryRenderer = GetComponent(); 62 | if (inventoryRenderer == null) { throw new NullReferenceException("Could not find a renderer. This is not allowed!"); } 63 | 64 | // Find the canvas 65 | var canvases = GetComponentsInParent(); 66 | if (canvases.Length == 0) { throw new NullReferenceException("Could not find a canvas."); } 67 | _canvas = canvases[canvases.Length - 1]; 68 | } 69 | 70 | /* 71 | * Grid was clicked (IPointerDownHandler) 72 | */ 73 | public void OnPointerDown(PointerEventData eventData) 74 | { 75 | if (_draggedItem != null) return; 76 | // Get which item to drag (item will be null of none were found) 77 | var grid = ScreenToGrid(eventData.position); 78 | _itemToDrag = inventory.GetAtPoint(grid); 79 | } 80 | 81 | /* 82 | * Dragging started (IBeginDragHandler) 83 | */ 84 | public void OnBeginDrag(PointerEventData eventData) 85 | { 86 | inventoryRenderer.ClearSelection(); 87 | 88 | if (_itemToDrag == null || _draggedItem != null) return; 89 | 90 | var localPosition = ScreenToLocalPositionInRenderer(eventData.position); 91 | var itemOffest = inventoryRenderer.GetItemOffset(_itemToDrag); 92 | var offset = itemOffest - localPosition; 93 | 94 | // Create a dragged item 95 | _draggedItem = new InventoryDraggedItem( 96 | _canvas, 97 | this, 98 | _itemToDrag.position, 99 | _itemToDrag, 100 | offset 101 | ); 102 | 103 | // Remove the item from inventory 104 | inventory.TryRemove(_itemToDrag); 105 | 106 | onItemPickedUp?.Invoke(_itemToDrag); 107 | } 108 | 109 | /* 110 | * Dragging is continuing (IDragHandler) 111 | */ 112 | public void OnDrag(PointerEventData eventData) 113 | { 114 | _currentEventData = eventData; 115 | if (_draggedItem != null) 116 | { 117 | // Update the items position 118 | //_draggedItem.Position = eventData.position; 119 | } 120 | } 121 | 122 | /* 123 | * Dragging stopped (IEndDragHandler) 124 | */ 125 | public void OnEndDrag(PointerEventData eventData) 126 | { 127 | if (_draggedItem == null) return; 128 | 129 | var mode = _draggedItem.Drop(eventData.position); 130 | 131 | switch (mode) 132 | { 133 | case InventoryDraggedItem.DropMode.Added: 134 | onItemAdded?.Invoke(_itemToDrag); 135 | break; 136 | case InventoryDraggedItem.DropMode.Swapped: 137 | onItemSwapped?.Invoke(_itemToDrag); 138 | break; 139 | case InventoryDraggedItem.DropMode.Returned: 140 | onItemReturned?.Invoke(_itemToDrag); 141 | break; 142 | case InventoryDraggedItem.DropMode.Dropped: 143 | onItemDropped?.Invoke(_itemToDrag); 144 | ClearHoveredItem(); 145 | break; 146 | } 147 | 148 | _draggedItem = null; 149 | _currentEventData = null; 150 | } 151 | 152 | /* 153 | * Pointer left the inventory (IPointerExitHandler) 154 | */ 155 | public void OnPointerExit(PointerEventData eventData) 156 | { 157 | if (_draggedItem != null) 158 | { 159 | // Clear the item as it leaves its current controller 160 | _draggedItem.currentController = null; 161 | inventoryRenderer.ClearSelection(); 162 | } 163 | else { ClearHoveredItem(); } 164 | _currentEventData = null; 165 | } 166 | 167 | /* 168 | * Pointer entered the inventory (IPointerEnterHandler) 169 | */ 170 | public void OnPointerEnter(PointerEventData eventData) 171 | { 172 | if (_draggedItem != null) 173 | { 174 | // Change which controller is in control of the dragged item 175 | _draggedItem.currentController = this; 176 | } 177 | _currentEventData = eventData; 178 | } 179 | 180 | /* 181 | * Update loop 182 | */ 183 | void Update() 184 | { 185 | if (_currentEventData == null) return; 186 | 187 | if (_draggedItem == null) 188 | { 189 | // Detect hover 190 | var grid = ScreenToGrid(_currentEventData.position); 191 | var item = inventory.GetAtPoint(grid); 192 | if (item == _lastHoveredItem) return; 193 | onItemHovered?.Invoke(item); 194 | _lastHoveredItem = item; 195 | } 196 | else 197 | { 198 | // Update position while dragging 199 | _draggedItem.position = _currentEventData.position; 200 | } 201 | } 202 | 203 | /* 204 | * 205 | */ 206 | private void ClearHoveredItem() 207 | { 208 | if (_lastHoveredItem != null) 209 | { 210 | onItemHovered?.Invoke(null); 211 | } 212 | _lastHoveredItem = null; 213 | } 214 | 215 | /* 216 | * Get a point on the grid from a given screen point 217 | */ 218 | internal Vector2Int ScreenToGrid(Vector2 screenPoint) 219 | { 220 | var pos = ScreenToLocalPositionInRenderer(screenPoint); 221 | var sizeDelta = inventoryRenderer.rectTransform.sizeDelta; 222 | pos.x += sizeDelta.x / 2; 223 | pos.y += sizeDelta.y / 2; 224 | return new Vector2Int(Mathf.FloorToInt(pos.x / inventoryRenderer.cellSize.x), Mathf.FloorToInt(pos.y / inventoryRenderer.cellSize.y)); 225 | } 226 | 227 | private Vector2 ScreenToLocalPositionInRenderer(Vector2 screenPosition) 228 | { 229 | RectTransformUtility.ScreenPointToLocalPointInRectangle( 230 | inventoryRenderer.rectTransform, 231 | screenPosition, 232 | _canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : _canvas.worldCamera, 233 | out var localPosition 234 | ); 235 | return localPosition; 236 | } 237 | } 238 | } 239 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35c3665acf72a44079b74bdede391c31 3 | timeCreated: 1509389781 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryDraggedItem.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace FarrokhGames.Inventory 6 | { 7 | /// 8 | /// Class for keeping track of dragged items 9 | /// 10 | public class InventoryDraggedItem 11 | { 12 | public enum DropMode 13 | { 14 | Added, 15 | Swapped, 16 | Returned, 17 | Dropped, 18 | } 19 | 20 | /// 21 | /// Returns the InventoryController this item originated from 22 | /// 23 | public InventoryController originalController { get; private set; } 24 | 25 | /// 26 | /// Returns the point inside the inventory from which this item originated from 27 | /// 28 | public Vector2Int originPoint { get; private set; } 29 | 30 | /// 31 | /// Returns the item-instance that is being dragged 32 | /// 33 | public IInventoryItem item { get; private set; } 34 | 35 | /// 36 | /// Gets or sets the InventoryController currently in control of this item 37 | /// 38 | public InventoryController currentController; 39 | 40 | private readonly Canvas _canvas; 41 | private readonly RectTransform _canvasRect; 42 | private readonly Image _image; 43 | private Vector2 _offset; 44 | 45 | /// 46 | /// Constructor 47 | /// 48 | /// The canvas 49 | /// The InventoryController this item originated from 50 | /// The point inside the inventory from which this item originated from 51 | /// The item-instance that is being dragged 52 | /// The starting offset of this item 53 | [SuppressMessage("ReSharper", "Unity.InefficientPropertyAccess")] 54 | public InventoryDraggedItem( 55 | Canvas canvas, 56 | InventoryController originalController, 57 | Vector2Int originPoint, 58 | IInventoryItem item, 59 | Vector2 offset) 60 | { 61 | this.originalController = originalController; 62 | currentController = this.originalController; 63 | this.originPoint = originPoint; 64 | this.item = item; 65 | 66 | _canvas = canvas; 67 | _canvasRect = canvas.transform as RectTransform; 68 | 69 | _offset = offset; 70 | 71 | // Create an image representing the dragged item 72 | _image = new GameObject("DraggedItem").AddComponent(); 73 | _image.raycastTarget = false; 74 | _image.transform.SetParent(_canvas.transform); 75 | _image.transform.SetAsLastSibling(); 76 | _image.transform.localScale = Vector3.one; 77 | _image.sprite = item.sprite; 78 | _image.SetNativeSize(); 79 | } 80 | 81 | /// 82 | /// Gets or sets the position of this dragged item 83 | /// 84 | public Vector2 position 85 | { 86 | set 87 | { 88 | // Move the image 89 | var camera = _canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : _canvas.worldCamera; 90 | RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, value + _offset, camera, out var newValue); 91 | _image.rectTransform.localPosition = newValue; 92 | 93 | 94 | // Make selections 95 | if (currentController != null) 96 | { 97 | item.position = currentController.ScreenToGrid(value + _offset + GetDraggedItemOffset(currentController.inventoryRenderer, item)); 98 | var canAdd = currentController.inventory.CanAddAt(item, item.position) || CanSwap(); 99 | currentController.inventoryRenderer.SelectItem(item, !canAdd, Color.white); 100 | } 101 | 102 | // Slowly animate the item towards the center of the mouse pointer 103 | _offset = Vector2.Lerp(_offset, Vector2.zero, Time.deltaTime * 10f); 104 | } 105 | } 106 | 107 | /// 108 | /// Drop this item at the given position 109 | /// 110 | public DropMode Drop(Vector2 pos) 111 | { 112 | DropMode mode; 113 | if (currentController != null) 114 | { 115 | var grid = currentController.ScreenToGrid(pos + _offset + GetDraggedItemOffset(currentController.inventoryRenderer, item)); 116 | 117 | // Try to add new item 118 | if (currentController.inventory.CanAddAt(item, grid)) 119 | { 120 | currentController.inventory.TryAddAt(item, grid); // Place the item in a new location 121 | mode = DropMode.Added; 122 | } 123 | // Adding did not work, try to swap 124 | else if (CanSwap()) 125 | { 126 | var otherItem = currentController.inventory.allItems[0]; 127 | currentController.inventory.TryRemove(otherItem); 128 | originalController.inventory.TryAdd(otherItem); 129 | currentController.inventory.TryAdd(item); 130 | mode = DropMode.Swapped; 131 | } 132 | // Could not add or swap, return the item 133 | else 134 | { 135 | originalController.inventory.TryAddAt(item, originPoint); // Return the item to its previous location 136 | mode = DropMode.Returned; 137 | 138 | } 139 | 140 | currentController.inventoryRenderer.ClearSelection(); 141 | } 142 | else 143 | { 144 | mode = DropMode.Dropped; 145 | if (!originalController.inventory.TryForceDrop(item)) // Drop the item on the ground 146 | { 147 | originalController.inventory.TryAddAt(item, originPoint); 148 | } 149 | } 150 | 151 | // Destroy the image representing the item 152 | Object.Destroy(_image.gameObject); 153 | 154 | return mode; 155 | } 156 | 157 | /* 158 | * Returns the offset between dragged item and the grid 159 | */ 160 | private Vector2 GetDraggedItemOffset(InventoryRenderer renderer, IInventoryItem item) 161 | { 162 | var scale = new Vector2( 163 | Screen.width / _canvasRect.sizeDelta.x, 164 | Screen.height / _canvasRect.sizeDelta.y 165 | ); 166 | var gx = -(item.width * renderer.cellSize.x / 2f) + (renderer.cellSize.x / 2); 167 | var gy = -(item.height * renderer.cellSize.y / 2f) + (renderer.cellSize.y / 2); 168 | return new Vector2(gx, gy) * scale; 169 | } 170 | 171 | /* 172 | * Returns true if its possible to swap 173 | */ 174 | private bool CanSwap() 175 | { 176 | if (!currentController.inventory.CanSwap(item)) return false; 177 | var otherItem = currentController.inventory.allItems[0]; 178 | return originalController.inventory.CanAdd(otherItem) && currentController.inventory.CanRemove(otherItem); 179 | } 180 | } 181 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryDraggedItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f73b0139252424a87ae7d1fb36a957ed 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEngine; 4 | 5 | namespace FarrokhGames.Inventory 6 | { 7 | public class InventoryManager : IInventoryManager 8 | { 9 | private Vector2Int _size = Vector2Int.one; 10 | private IInventoryProvider _provider; 11 | private Rect _fullRect; 12 | 13 | public InventoryManager(IInventoryProvider provider, int width, int height) 14 | { 15 | _provider = provider; 16 | Rebuild(); 17 | Resize(width, height); 18 | } 19 | 20 | /// 21 | public int width => _size.x; 22 | 23 | /// 24 | public int height => _size.y; 25 | 26 | /// 27 | public void Resize(int newWidth, int newHeight) 28 | { 29 | _size.x = newWidth; 30 | _size.y = newHeight; 31 | RebuildRect(); 32 | } 33 | 34 | private void RebuildRect() 35 | { 36 | _fullRect = new Rect(0, 0, _size.x, _size.y); 37 | HandleSizeChanged(); 38 | onResized?.Invoke(); 39 | } 40 | 41 | private void HandleSizeChanged() 42 | { 43 | // Drop all items that no longer fit the inventory 44 | for (int i = 0; i < allItems.Length;) 45 | { 46 | var item = allItems[i]; 47 | var shouldBeDropped = false; 48 | var padding = Vector2.one * 0.01f; 49 | 50 | if (!_fullRect.Contains(item.GetMinPoint() + padding) || !_fullRect.Contains(item.GetMaxPoint() - padding)) 51 | { 52 | shouldBeDropped = true; 53 | } 54 | 55 | if (shouldBeDropped) 56 | { 57 | TryDrop(item); 58 | } 59 | else 60 | { 61 | i++; 62 | } 63 | } 64 | } 65 | 66 | /// 67 | public void Rebuild() 68 | { 69 | Rebuild(false); 70 | } 71 | 72 | private void Rebuild(bool silent) 73 | { 74 | allItems = new IInventoryItem[_provider.inventoryItemCount]; 75 | for (var i = 0; i < _provider.inventoryItemCount; i++) 76 | { 77 | allItems[i] = _provider.GetInventoryItem(i); 78 | } 79 | if (!silent)onRebuilt?.Invoke(); 80 | } 81 | 82 | public void Dispose() 83 | { 84 | _provider = null; 85 | allItems = null; 86 | } 87 | 88 | /// 89 | public bool isFull 90 | { 91 | get 92 | { 93 | if (_provider.isInventoryFull)return true; 94 | 95 | for (var x = 0; x < width; x++) 96 | { 97 | for (var y = 0; y < height; y++) 98 | { 99 | if (GetAtPoint(new Vector2Int(x, y)) == null) { return false; } 100 | } 101 | } 102 | return true; 103 | } 104 | } 105 | 106 | /// 107 | public IInventoryItem[] allItems { get; private set; } 108 | 109 | /// 110 | public Action onRebuilt { get; set; } 111 | 112 | /// 113 | public Action onItemDropped { get; set; } 114 | 115 | /// 116 | public Action onItemDroppedFailed { get; set; } 117 | 118 | /// 119 | public Action onItemAdded { get; set; } 120 | 121 | /// 122 | public Action onItemAddedFailed { get; set; } 123 | 124 | /// 125 | public Action onItemRemoved { get; set; } 126 | 127 | /// 128 | public Action onResized { get; set; } 129 | 130 | /// 131 | public IInventoryItem GetAtPoint(Vector2Int point) 132 | { 133 | // Single item override 134 | if (_provider.inventoryRenderMode == InventoryRenderMode.Single && _provider.isInventoryFull && allItems.Length > 0) 135 | { 136 | return allItems[0]; 137 | } 138 | 139 | foreach (var item in allItems) 140 | { 141 | if (item.Contains(point)) { return item; } 142 | } 143 | return null; 144 | } 145 | 146 | /// 147 | public IInventoryItem[] GetAtPoint(Vector2Int point, Vector2Int size) 148 | { 149 | var posibleItems = new IInventoryItem[size.x * size.y]; 150 | var c = 0; 151 | for (var x = 0; x < size.x; x++) 152 | { 153 | for (var y = 0; y < size.y; y++) 154 | { 155 | posibleItems[c] = GetAtPoint(point + new Vector2Int(x, y)); 156 | c++; 157 | } 158 | } 159 | return posibleItems.Distinct().Where(x => x != null).ToArray(); 160 | } 161 | 162 | /// 163 | public bool TryRemove(IInventoryItem item) 164 | { 165 | if (!CanRemove(item)) return false; 166 | if (!_provider.RemoveInventoryItem(item)) return false; 167 | Rebuild(true); 168 | onItemRemoved?.Invoke(item); 169 | return true; 170 | } 171 | 172 | /// 173 | public bool TryDrop(IInventoryItem item) 174 | { 175 | if (!CanDrop(item) || !_provider.DropInventoryItem(item)) 176 | { 177 | onItemDroppedFailed?.Invoke(item); 178 | return false; 179 | } 180 | Rebuild(true); 181 | onItemDropped?.Invoke(item); 182 | return true; 183 | } 184 | 185 | internal bool TryForceDrop(IInventoryItem item) 186 | { 187 | if(!item.canDrop) 188 | { 189 | onItemDroppedFailed?.Invoke(item); 190 | return false; 191 | } 192 | onItemDropped?.Invoke(item); 193 | return true; 194 | } 195 | 196 | /// 197 | public bool CanAddAt(IInventoryItem item, Vector2Int point) 198 | { 199 | if (!_provider.CanAddInventoryItem(item) || _provider.isInventoryFull) 200 | { 201 | return false; 202 | } 203 | 204 | if (_provider.inventoryRenderMode == InventoryRenderMode.Single) 205 | { 206 | return true; 207 | } 208 | 209 | var previousPoint = item.position; 210 | item.position = point; 211 | var padding = Vector2.one * 0.01f; 212 | 213 | // Check if item is outside of inventory 214 | if (!_fullRect.Contains(item.GetMinPoint() + padding) || !_fullRect.Contains(item.GetMaxPoint() - padding)) 215 | { 216 | item.position = previousPoint; 217 | return false; 218 | } 219 | 220 | // Check if item overlaps another item already in the inventory 221 | if (!allItems.Any(otherItem => item.Overlaps(otherItem))) return true; // Item can be added 222 | item.position = previousPoint; 223 | return false; 224 | 225 | } 226 | 227 | /// 228 | public bool TryAddAt(IInventoryItem item, Vector2Int point) 229 | { 230 | if (!CanAddAt(item, point) || !_provider.AddInventoryItem(item)) 231 | { 232 | onItemAddedFailed?.Invoke(item); 233 | return false; 234 | } 235 | switch (_provider.inventoryRenderMode) 236 | { 237 | case InventoryRenderMode.Single: 238 | item.position = GetCenterPosition(item); 239 | break; 240 | case InventoryRenderMode.Grid: 241 | item.position = point; 242 | break; 243 | default: 244 | throw new NotImplementedException($"InventoryRenderMode.{_provider.inventoryRenderMode.ToString()} have not yet been implemented"); 245 | } 246 | Rebuild(true); 247 | onItemAdded?.Invoke(item); 248 | return true; 249 | } 250 | 251 | /// 252 | public bool CanAdd(IInventoryItem item) 253 | { 254 | Vector2Int point; 255 | if (!Contains(item) && GetFirstPointThatFitsItem(item, out point)) 256 | { 257 | return CanAddAt(item, point); 258 | } 259 | return false; 260 | } 261 | 262 | /// 263 | public bool TryAdd(IInventoryItem item) 264 | { 265 | if (!CanAdd(item))return false; 266 | Vector2Int point; 267 | return GetFirstPointThatFitsItem(item, out point) && TryAddAt(item, point); 268 | } 269 | 270 | /// 271 | public bool CanSwap(IInventoryItem item) 272 | { 273 | return _provider.inventoryRenderMode == InventoryRenderMode.Single && 274 | DoesItemFit(item) && 275 | _provider.CanAddInventoryItem(item); 276 | } 277 | 278 | /// 279 | public void DropAll() 280 | { 281 | var itemsToDrop = allItems.ToArray(); 282 | foreach (var item in itemsToDrop) 283 | { 284 | TryDrop(item); 285 | } 286 | } 287 | 288 | /// 289 | public void Clear() 290 | { 291 | foreach (var item in allItems) 292 | { 293 | TryRemove(item); 294 | } 295 | } 296 | 297 | /// 298 | public bool Contains(IInventoryItem item) => allItems.Contains(item); 299 | 300 | 301 | /// 302 | public bool CanRemove(IInventoryItem item) => Contains(item) && _provider.CanRemoveInventoryItem(item); 303 | 304 | /// 305 | public bool CanDrop(IInventoryItem item) => Contains(item) && _provider.CanDropInventoryItem(item) && item.canDrop; 306 | 307 | /* 308 | * Get first free point that will fit the given item 309 | */ 310 | private bool GetFirstPointThatFitsItem(IInventoryItem item, out Vector2Int point) 311 | { 312 | if (DoesItemFit(item)) 313 | { 314 | for (var x = 0; x < width - (item.width - 1); x++) 315 | { 316 | for (var y = 0; y < height - (item.height - 1); y++) 317 | { 318 | point = new Vector2Int(x, y); 319 | if (CanAddAt(item, point))return true; 320 | } 321 | } 322 | } 323 | point = Vector2Int.zero; 324 | return false; 325 | } 326 | 327 | /* 328 | * Returns true if given items physically fits within this inventory 329 | */ 330 | private bool DoesItemFit(IInventoryItem item) => item.width <= width && item.height <= height; 331 | 332 | /* 333 | * Returns the center post position for a given item within this inventory 334 | */ 335 | private Vector2Int GetCenterPosition(IInventoryItem item) 336 | { 337 | return new Vector2Int( 338 | (_size.x - item.width) / 2, 339 | (_size.y - item.height) / 2 340 | ); 341 | } 342 | } 343 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57ecc3ee7eb2641ffae555f6e15e5038 3 | timeCreated: 1509651499 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryRenderMode.cs: -------------------------------------------------------------------------------- 1 | namespace FarrokhGames.Inventory 2 | { 3 | public enum InventoryRenderMode 4 | { 5 | Grid, 6 | Single, 7 | } 8 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryRenderMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e04cf8767cdde40caae955110e36959c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryRenderer.cs: -------------------------------------------------------------------------------- 1 | using FarrokhGames.Shared; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace FarrokhGames.Inventory 8 | { 9 | /// 10 | /// Renders a given inventory 11 | /// /// 12 | [RequireComponent(typeof(RectTransform))] 13 | public class InventoryRenderer : MonoBehaviour 14 | { 15 | [SerializeField, Tooltip("The size of the cells building up the inventory")] 16 | private Vector2Int _cellSize = new Vector2Int(32, 32); 17 | 18 | [SerializeField, Tooltip("The sprite to use for empty cells")] 19 | private Sprite _cellSpriteEmpty = null; 20 | 21 | [SerializeField, Tooltip("The sprite to use for selected cells")] 22 | private Sprite _cellSpriteSelected = null; 23 | 24 | [SerializeField, Tooltip("The sprite to use for blocked cells")] 25 | private Sprite _cellSpriteBlocked = null; 26 | 27 | internal IInventoryManager inventory; 28 | InventoryRenderMode _renderMode; 29 | private bool _haveListeners; 30 | private Pool _imagePool; 31 | private Image[] _grids; 32 | private Dictionary _items = new Dictionary(); 33 | 34 | /* 35 | * Setup 36 | */ 37 | void Awake() 38 | { 39 | rectTransform = GetComponent(); 40 | 41 | // Create the image container 42 | var imageContainer = new GameObject("Image Pool").AddComponent(); 43 | imageContainer.transform.SetParent(transform); 44 | imageContainer.transform.localPosition = Vector3.zero; 45 | imageContainer.transform.localScale = Vector3.one; 46 | 47 | // Create pool of images 48 | _imagePool = new Pool( 49 | delegate 50 | { 51 | var image = new GameObject("Image").AddComponent(); 52 | image.transform.SetParent(imageContainer); 53 | image.transform.localScale = Vector3.one; 54 | return image; 55 | }); 56 | } 57 | 58 | /// 59 | /// Set what inventory to use when rendering 60 | /// 61 | public void SetInventory(IInventoryManager inventoryManager, InventoryRenderMode renderMode) 62 | { 63 | OnDisable(); 64 | inventory = inventoryManager ?? throw new ArgumentNullException(nameof(inventoryManager)); 65 | _renderMode = renderMode; 66 | OnEnable(); 67 | } 68 | 69 | /// 70 | /// Returns the RectTransform for this renderer 71 | /// 72 | public RectTransform rectTransform { get; private set; } 73 | 74 | /// 75 | /// Returns the size of this inventory's cells 76 | /// 77 | public Vector2 cellSize => _cellSize; 78 | 79 | /* 80 | Invoked when the inventory inventoryRenderer is enabled 81 | */ 82 | void OnEnable() 83 | { 84 | if (inventory != null && !_haveListeners) 85 | { 86 | if (_cellSpriteEmpty == null) { throw new NullReferenceException("Sprite for empty cell is null"); } 87 | if (_cellSpriteSelected == null) { throw new NullReferenceException("Sprite for selected cells is null."); } 88 | if (_cellSpriteBlocked == null) { throw new NullReferenceException("Sprite for blocked cells is null."); } 89 | 90 | inventory.onRebuilt += ReRenderAllItems; 91 | inventory.onItemAdded += HandleItemAdded; 92 | inventory.onItemRemoved += HandleItemRemoved; 93 | inventory.onItemDropped += HandleItemRemoved; 94 | inventory.onResized += HandleResized; 95 | _haveListeners = true; 96 | 97 | // Render inventory 98 | ReRenderGrid(); 99 | ReRenderAllItems(); 100 | } 101 | } 102 | 103 | /* 104 | Invoked when the inventory inventoryRenderer is disabled 105 | */ 106 | void OnDisable() 107 | { 108 | if (inventory != null && _haveListeners) 109 | { 110 | inventory.onRebuilt -= ReRenderAllItems; 111 | inventory.onItemAdded -= HandleItemAdded; 112 | inventory.onItemRemoved -= HandleItemRemoved; 113 | inventory.onItemDropped -= HandleItemRemoved; 114 | inventory.onResized -= HandleResized; 115 | _haveListeners = false; 116 | } 117 | } 118 | 119 | /* 120 | Clears and renders the grid. This must be done whenever the size of the inventory changes 121 | */ 122 | private void ReRenderGrid() 123 | { 124 | // Clear the grid 125 | if (_grids != null) 126 | { 127 | for (var i = 0; i < _grids.Length; i++) 128 | { 129 | _grids[i].gameObject.SetActive(false); 130 | RecycleImage(_grids[i]); 131 | _grids[i].transform.SetSiblingIndex(i); 132 | } 133 | } 134 | _grids = null; 135 | 136 | // Render new grid 137 | var containerSize = new Vector2(cellSize.x * inventory.width, cellSize.y * inventory.height); 138 | Image grid; 139 | switch (_renderMode) 140 | { 141 | case InventoryRenderMode.Single: 142 | grid = CreateImage(_cellSpriteEmpty, true); 143 | grid.rectTransform.SetAsFirstSibling(); 144 | grid.type = Image.Type.Sliced; 145 | grid.rectTransform.localPosition = Vector3.zero; 146 | grid.rectTransform.sizeDelta = containerSize; 147 | _grids = new[] { grid }; 148 | break; 149 | default: 150 | // Spawn grid images 151 | var topLeft = new Vector3(-containerSize.x / 2, -containerSize.y / 2, 0); // Calculate topleft corner 152 | var halfCellSize = new Vector3(cellSize.x / 2, cellSize.y / 2, 0); // Calulcate cells half-size 153 | _grids = new Image[inventory.width * inventory.height]; 154 | var c = 0; 155 | for (int y = 0; y < inventory.height; y++) 156 | { 157 | for (int x = 0; x < inventory.width; x++) 158 | { 159 | grid = CreateImage(_cellSpriteEmpty, true); 160 | grid.gameObject.name = "Grid " + c; 161 | grid.rectTransform.SetAsFirstSibling(); 162 | grid.type = Image.Type.Sliced; 163 | grid.rectTransform.localPosition = topLeft + new Vector3(cellSize.x * ((inventory.width - 1) - x), cellSize.y * y, 0) + halfCellSize; 164 | grid.rectTransform.sizeDelta = cellSize; 165 | _grids[c] = grid; 166 | c++; 167 | } 168 | } 169 | break; 170 | } 171 | 172 | // Set the size of the main RectTransform 173 | // This is useful as it allowes custom graphical elements 174 | // suchs as a border to mimic the size of the inventory. 175 | rectTransform.sizeDelta = containerSize; 176 | } 177 | 178 | /* 179 | Clears and renders all items 180 | */ 181 | private void ReRenderAllItems() 182 | { 183 | // Clear all items 184 | foreach (var image in _items.Values) 185 | { 186 | image.gameObject.SetActive(false); 187 | RecycleImage(image); 188 | } 189 | _items.Clear(); 190 | 191 | // Add all items 192 | foreach (var item in inventory.allItems) 193 | { 194 | HandleItemAdded(item); 195 | } 196 | } 197 | 198 | /* 199 | Handler for when inventory.OnItemAdded is invoked 200 | */ 201 | private void HandleItemAdded(IInventoryItem item) 202 | { 203 | var img = CreateImage(item.sprite, false); 204 | 205 | if (_renderMode == InventoryRenderMode.Single) 206 | { 207 | img.rectTransform.localPosition = rectTransform.rect.center; 208 | } 209 | else 210 | { 211 | img.rectTransform.localPosition = GetItemOffset(item); 212 | } 213 | 214 | _items.Add(item, img); 215 | } 216 | 217 | /* 218 | Handler for when inventory.OnItemRemoved is invoked 219 | */ 220 | private void HandleItemRemoved(IInventoryItem item) 221 | { 222 | if (_items.ContainsKey(item)) 223 | { 224 | var image = _items[item]; 225 | image.gameObject.SetActive(false); 226 | RecycleImage(image); 227 | _items.Remove(item); 228 | } 229 | } 230 | 231 | /* 232 | Handler for when inventory.OnResized is invoked 233 | */ 234 | private void HandleResized() 235 | { 236 | ReRenderGrid(); 237 | ReRenderAllItems(); 238 | } 239 | 240 | /* 241 | * Create an image with given sprite and settings 242 | */ 243 | private Image CreateImage(Sprite sprite, bool raycastTarget) 244 | { 245 | var img = _imagePool.Take(); 246 | img.gameObject.SetActive(true); 247 | img.sprite = sprite; 248 | img.rectTransform.sizeDelta = new Vector2(img.sprite.rect.width, img.sprite.rect.height); 249 | img.transform.SetAsLastSibling(); 250 | img.type = Image.Type.Simple; 251 | img.raycastTarget = raycastTarget; 252 | return img; 253 | } 254 | 255 | /* 256 | * Recycles given image 257 | */ 258 | private void RecycleImage(Image image) 259 | { 260 | image.gameObject.name = "Image"; 261 | image.gameObject.SetActive(false); 262 | _imagePool.Recycle(image); 263 | } 264 | 265 | /// 266 | /// Selects a given item in the inventory 267 | /// 268 | /// Item to select 269 | /// Should the selection be rendered as blocked 270 | /// The color of the selection 271 | public void SelectItem(IInventoryItem item, bool blocked, Color color) 272 | { 273 | if (item == null) { return; } 274 | ClearSelection(); 275 | 276 | switch (_renderMode) 277 | { 278 | case InventoryRenderMode.Single: 279 | _grids[0].sprite = blocked ? _cellSpriteBlocked : _cellSpriteSelected; 280 | _grids[0].color = color; 281 | break; 282 | default: 283 | for (var x = 0; x < item.width; x++) 284 | { 285 | for (var y = 0; y < item.height; y++) 286 | { 287 | if (item.IsPartOfShape(new Vector2Int(x, y))) 288 | { 289 | var p = item.position + new Vector2Int(x, y); 290 | if (p.x >= 0 && p.x < inventory.width && p.y >= 0 && p.y < inventory.height) 291 | { 292 | var index = p.y * inventory.width + ((inventory.width - 1) - p.x); 293 | _grids[index].sprite = blocked ? _cellSpriteBlocked : _cellSpriteSelected; 294 | _grids[index].color = color; 295 | } 296 | } 297 | } 298 | } 299 | break; 300 | } 301 | } 302 | 303 | /// 304 | /// Clears all selections made in this inventory 305 | /// 306 | public void ClearSelection() 307 | { 308 | for (var i = 0; i < _grids.Length; i++) 309 | { 310 | _grids[i].sprite = _cellSpriteEmpty; 311 | _grids[i].color = Color.white; 312 | } 313 | } 314 | 315 | /* 316 | Returns the appropriate offset of an item to make it fit nicely in the grid 317 | */ 318 | internal Vector2 GetItemOffset(IInventoryItem item) 319 | { 320 | var x = (-(inventory.width * 0.5f) + item.position.x + item.width * 0.5f) * cellSize.x; 321 | var y = (-(inventory.height * 0.5f) + item.position.y + item.height * 0.5f) * cellSize.y; 322 | return new Vector2(x, y); 323 | } 324 | } 325 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d94136e1ae0d24bafae3a43835aaf85b 3 | timeCreated: 1509388083 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryShape.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace FarrokhGames.Inventory 5 | { 6 | /// 7 | /// Class for storing the shape of an inventory item 8 | /// 9 | [Serializable] 10 | public class InventoryShape 11 | { 12 | [SerializeField] int _width; 13 | [SerializeField] int _height; 14 | [SerializeField] bool[] _shape; 15 | 16 | /// 17 | /// CTOR 18 | /// 19 | /// The maximum width of the shape 20 | /// The maximum height of the shape 21 | public InventoryShape(int width, int height) 22 | { 23 | _width = width; 24 | _height = height; 25 | _shape = new bool[_width * _height]; 26 | } 27 | 28 | /// 29 | /// Constructor 30 | /// 31 | /// A custom shape 32 | public InventoryShape(bool[, ] shape) 33 | { 34 | _width = shape.GetLength(0); 35 | _height = shape.GetLength(1); 36 | _shape = new bool[_width * _height]; 37 | for (int x = 0; x < _width; x++) 38 | { 39 | for (int y = 0; y < _height; y++) 40 | { 41 | _shape[GetIndex(x, y)] = shape[x, y]; 42 | } 43 | } 44 | } 45 | 46 | /// 47 | /// Returns the width of the shapes bounding box 48 | /// 49 | public int width => _width; 50 | 51 | /// 52 | /// Returns the height of the shapes bounding box 53 | /// 54 | public int height => _height; 55 | 56 | /// 57 | /// Returns true if given local point is part of this shape 58 | /// 59 | public bool IsPartOfShape(Vector2Int localPoint) 60 | { 61 | if (localPoint.x < 0 || localPoint.x >= _width || localPoint.y < 0 || localPoint.y >= _height) 62 | { 63 | return false; // outside of shape width/height 64 | } 65 | 66 | var index = GetIndex(localPoint.x, localPoint.y); 67 | return _shape[index]; 68 | } 69 | 70 | /* 71 | Converts X & Y to an index to use with _shape 72 | */ 73 | private int GetIndex(int x, int y) 74 | { 75 | y = (_height - 1) - y; 76 | return x + _width * y; 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/InventoryShape.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da30e673342214922b46de75041baa86 3 | timeCreated: 1509225315 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/Pool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System; 3 | using System.Linq; 4 | 5 | namespace FarrokhGames.Shared 6 | { 7 | /// 8 | /// A generic pool of objects that can be retrieved and recycled without invoking additional allocations. 9 | /// 10 | /// Please note that care must be taken when pooling objects, since the object 11 | /// has to be manually reset after retrieval from the pool. Its constructor will 12 | /// not be run again after the first time! 13 | /// 14 | public sealed class Pool where T : class 15 | { 16 | private List _inactive = new List(); 17 | private List _active = new List(); 18 | private Func _creator; 19 | private bool _allowTakingWhenEmpty; 20 | 21 | /// 22 | /// Constructor 23 | /// 24 | /// A function to be used for creating new objects 25 | /// Initial count of objects in the pool 26 | /// If true, objects can be taken from the pool even when the pool is empty 27 | public Pool(Func creator, int initialCount = 0, bool allowTakingWhenEmpty = true) 28 | { 29 | if (creator == null) throw new ArgumentNullException("pCreator"); 30 | if (initialCount < 0) throw new ArgumentOutOfRangeException("pInitialCount", "Initial count cannot be negative"); 31 | 32 | _creator = creator; 33 | _inactive.Capacity = initialCount; 34 | _allowTakingWhenEmpty = allowTakingWhenEmpty; 35 | 36 | // Create initial items 37 | while (_inactive.Count < initialCount) 38 | { 39 | _inactive.Add(_creator()); 40 | } 41 | } 42 | 43 | /// 44 | /// Returns the current number of objects in the pool 45 | /// 46 | public int Count => _inactive.Count; 47 | 48 | /// 49 | /// Returns true if the pool is empty. 50 | /// Note that objects can still be taken from an empty pool, if allowTakingWhenEmpty 51 | /// is set to true, but that additional allocations will be imposed. 52 | public bool IsEmpty => Count == 0; 53 | 54 | /// 55 | /// Returns true of an item can be taken from the pool right now. 56 | /// This is not the same as whether or not the pool is empty. 57 | /// 58 | public bool CanTake => _allowTakingWhenEmpty || !IsEmpty; 59 | 60 | /// 61 | /// Takes an object from the pool. 62 | /// If the pool is empty and allowTakingWhenEmpty is enabled, it will allocate 63 | /// a new object. Otherwise, a pooled object is returned. Either way, the object 64 | /// should eventually be returned to the pool by calling Recycle(). 65 | /// 66 | /// An object of type T, or null if nothing could be taken 67 | public T Take() 68 | { 69 | if (IsEmpty) 70 | { 71 | if (_allowTakingWhenEmpty) 72 | { 73 | var obj = _creator(); 74 | _inactive.Add(obj); 75 | return TakeInternal(); 76 | } 77 | else 78 | { 79 | return null; 80 | } 81 | } 82 | else 83 | { 84 | return TakeInternal(); 85 | } 86 | } 87 | 88 | private T TakeInternal() 89 | { 90 | T obj = _inactive[_inactive.Count - 1]; 91 | _inactive.RemoveAt(_inactive.Count - 1); 92 | _active.Add(obj); 93 | return obj; 94 | } 95 | 96 | /// 97 | /// Recycles an object into the pool. After this point, the object is 98 | /// considered dead and should not be used until taken from the pool 99 | /// again. 100 | /// 101 | public void Recycle(T item) 102 | { 103 | if (!_active.Contains(item)) { throw new InvalidOperationException("An item was recycled even though it was not part of the pool"); } 104 | _inactive.Add(item); 105 | _active.Remove(item); 106 | } 107 | 108 | /// 109 | /// Returns a copied list of all inactive items 110 | /// 111 | public List GetInactive() 112 | { 113 | return _inactive.ToList(); 114 | } 115 | 116 | /// 117 | /// Returns a copied list of all active items 118 | /// 119 | public List GetActive() 120 | { 121 | return _active.ToList(); 122 | } 123 | } 124 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Runtime/Pool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae571889a30b84477837c9fdf918ff5a 3 | timeCreated: 1509392983 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54f2e9dd9d45e4bdea5c8e0b0806f905 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/Farrokhgames.Inventory.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Farrokhgames.Inventory.Tests", 3 | "references": [ 4 | "Farrokhgames.Inventory" 5 | ], 6 | "includePlatforms": [ 7 | "Editor" 8 | ], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": false, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/Farrokhgames.Inventory.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b6e09c38de3144c188dbfdd86173fb1 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/InventoryManagerTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d99905ad6336d49249befb2d8c69f333 3 | timeCreated: 1509651552 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/InventoryShapeTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace FarrokhGames.Inventory 4 | { 5 | [TestFixture] 6 | public class InventoryShapeTests 7 | { 8 | [Test] 9 | public void CTOR_WidthAndHeightSet() 10 | { 11 | var shape = new InventoryShape(8, 12); 12 | 13 | Assert.That(shape.width, Is.EqualTo(8)); 14 | Assert.That(shape.height, Is.EqualTo(12)); 15 | } 16 | 17 | /* 18 | [Test] 19 | public void Overlaps_DontOverlap_ReturnsFalse() 20 | { 21 | var s1 = new bool[2, 2]; 22 | s1[0, 0] = true; 23 | s1[0, 1] = true; 24 | s1[1, 1] = true; 25 | var shape1 = new InventoryShape(s1); 26 | shape1.Position = new Vector2Int(0, 0); 27 | 28 | var s2 = new bool[2, 2]; 29 | s1[0, 1] = true; 30 | s1[1, 1] = true; 31 | s1[1, 0] = true; 32 | var shape2 = new InventoryShape(s2); 33 | shape2.Position = new Vector2Int(0, 1); 34 | 35 | Assert.That(shape1.Overlaps(shape2), Is.False); 36 | Assert.That(shape2.Overlaps(shape1), Is.False); 37 | } 38 | */ 39 | 40 | /* 41 | [Test] 42 | public void Overlaps_DoOverlap_ReturnsTrue() 43 | { 44 | var s1 = new bool[3, 1]; 45 | s1[0, 0] = true; 46 | s1[1, 0] = true; 47 | s1[2, 0] = true; 48 | var shape1 = new InventoryShape(s1); 49 | shape1.Position = new Vector2Int(0, 0); 50 | 51 | var s2 = new bool[1, 3]; 52 | s2[0, 0] = true; 53 | s2[0, 1] = true; 54 | s2[0, 2] = true; 55 | var shape2 = new InventoryShape(s2); 56 | shape2.Position = new Vector2Int(1, -1); 57 | 58 | Assert.That(shape1.Overlaps(shape2), Is.True); 59 | Assert.That(shape2.Overlaps(shape1), Is.True); 60 | } 61 | */ 62 | } 63 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/InventoryShapeTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c75d7109916846bd814d57ae3d0d427 3 | timeCreated: 1509484970 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/PoolTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | 4 | namespace FarrokhGames.Shared 5 | { 6 | [TestFixture] 7 | public class PoolTests 8 | { 9 | private class PoolObject { } 10 | 11 | private int _creatorCount; 12 | 13 | private PoolObject Creator() 14 | { 15 | _creatorCount++; 16 | return new PoolObject(); 17 | } 18 | 19 | [SetUp] 20 | public void Setup_PoolTests() 21 | { 22 | _creatorCount = 0; 23 | } 24 | 25 | [Test] 26 | public void CTOR_NullCreator_ArgumentNullException() 27 | { 28 | Assert.Throws(() => new Pool(null)); 29 | } 30 | 31 | [Test] 32 | public void CTOR_InitialCountLessThanZero_ArgumentOutOfRangeException() 33 | { 34 | Assert.Throws(() => new Pool(Creator, -1)); 35 | } 36 | 37 | [Test] 38 | public void CTOR_InitialCount_CreatesSameNumberOfObjects() 39 | { 40 | new Pool(Creator, 5, true); 41 | Assert.That(_creatorCount, Is.EqualTo(5)); 42 | } 43 | 44 | [Test] 45 | public void Count_ReturnsRightNumberOfObjects() 46 | { 47 | var pool = new Pool(Creator, 8, true); 48 | Assert.That(pool.Count, Is.EqualTo(8)); 49 | var toRecycele = pool.Take(); 50 | pool.Take(); 51 | Assert.That(pool.Count, Is.EqualTo(6)); 52 | pool.Recycle(toRecycele); 53 | Assert.That(pool.Count, Is.EqualTo(7)); 54 | } 55 | 56 | [TestCase(5, ExpectedResult = false)] 57 | [TestCase(0, ExpectedResult = true)] 58 | public bool IsEmpty_Success(int initialCount) 59 | { 60 | var pool = new Pool(Creator, initialCount); 61 | return pool.IsEmpty; 62 | } 63 | 64 | [TestCase(false, ExpectedResult = false)] 65 | [TestCase(true, ExpectedResult = true)] 66 | public bool CanTake_AllowedToTakeWhenEmpty_Success(bool allowTakingWhenEmpty) 67 | { 68 | var pool = new Pool(Creator, 0, allowTakingWhenEmpty); 69 | return pool.CanTake; 70 | } 71 | 72 | [Test] 73 | public void Take_Empty_ReturnsNull() 74 | { 75 | var pool = new Pool(Creator, 0, false); 76 | Assert.That(pool.Take(), Is.Null); 77 | } 78 | 79 | [Test] 80 | public void Take_FromInitialCount_NoNewObjectsCreated() 81 | { 82 | var pool = new Pool(Creator, 5, false); 83 | _creatorCount = 0; 84 | Assert.That(pool.Take(), Is.Not.Null); 85 | Assert.That(_creatorCount, Is.Zero); 86 | } 87 | 88 | [Test] 89 | public void Take_Empty_NewObjectsCreated() 90 | { 91 | var pool = new Pool(Creator, 2, true); 92 | _creatorCount = 0; 93 | pool.Take(); 94 | pool.Take(); 95 | Assert.That(pool.Take(), Is.Not.Null); 96 | Assert.That(pool.Take(), Is.Not.Null); 97 | Assert.That(pool.Take(), Is.Not.Null); 98 | Assert.That(_creatorCount, Is.EqualTo(3)); 99 | } 100 | 101 | [Test] 102 | public void Take_ObjectAreNotTheSame() 103 | { 104 | var pool = new Pool(Creator, 3, false); 105 | var obj1 = pool.Take(); 106 | var obj2 = pool.Take(); 107 | var obj3 = pool.Take(); 108 | Assert.That(obj1, Is.Not.SameAs(obj2)); 109 | Assert.That(obj2, Is.Not.SameAs(obj3)); 110 | Assert.That(obj3, Is.Not.SameAs(obj1)); 111 | } 112 | 113 | [Test] 114 | public void Recycle_NotPartOfPool_InvalidOperationException() 115 | { 116 | var pool = new Pool(Creator, 2, true); 117 | Assert.Throws(() => pool.Recycle(new PoolObject())); 118 | } 119 | 120 | [Test] 121 | public void Recycle_ObjectReturnedToThePool() 122 | { 123 | var pool = new Pool(Creator, 2, true); 124 | _creatorCount = 0; 125 | var obj = pool.Take(); 126 | Assert.That(pool.Count, Is.EqualTo(1)); 127 | pool.Recycle(obj); 128 | Assert.That(pool.Count, Is.EqualTo(2)); 129 | var obj1 = pool.Take(); 130 | var obj2 = pool.Take(); 131 | var obj3 = pool.Take(); 132 | Assert.That(_creatorCount, Is.EqualTo(1)); 133 | pool.Recycle(obj1); 134 | Assert.That(pool.Count, Is.EqualTo(1)); 135 | pool.Recycle(obj2); 136 | Assert.That(pool.Count, Is.EqualTo(2)); 137 | pool.Recycle(obj3); 138 | Assert.That(pool.Count, Is.EqualTo(3)); 139 | } 140 | 141 | [Test] 142 | public void GetInactive_ReturnsListOfUnactiveObjects() 143 | { 144 | var pool = new Pool(Creator, 5, true); 145 | Assert.That(pool.GetInactive().Count, Is.EqualTo(5)); 146 | var obj = pool.Take(); 147 | Assert.That(pool.GetInactive().Count, Is.EqualTo(4)); 148 | pool.Recycle(obj); 149 | Assert.That(pool.GetInactive().Count, Is.EqualTo(5)); 150 | } 151 | 152 | [Test] 153 | public void GetInactive_ReturnsCopies() 154 | { 155 | var pool = new Pool(Creator, 5, true); 156 | var inactive1 = pool.GetInactive(); 157 | var inactive2 = pool.GetInactive(); 158 | Assert.That(inactive1, Is.Not.SameAs(inactive2)); 159 | } 160 | 161 | [Test] 162 | public void GetActive_ReturnsListOfUnactiveObjects() 163 | { 164 | var pool = new Pool(Creator, 1, true); 165 | Assert.That(pool.GetActive().Count, Is.EqualTo(0)); 166 | var obj = pool.Take(); 167 | Assert.That(pool.GetActive().Count, Is.EqualTo(1)); 168 | pool.Recycle(obj); 169 | Assert.That(pool.GetActive().Count, Is.EqualTo(0)); 170 | } 171 | 172 | [Test] 173 | public void GetActive_ReturnsCopies() 174 | { 175 | var pool = new Pool(Creator, 1, true); 176 | var active1 = pool.GetActive(); 177 | var active2 = pool.GetActive(); 178 | Assert.That(active1, Is.Not.SameAs(active2)); 179 | } 180 | } 181 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/PoolTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a27c86f46efe0466f8f477a58e2d8cea 3 | timeCreated: 1509471071 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/TestItem.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace FarrokhGames.Inventory 4 | { 5 | public class TestItem : IInventoryItem 6 | { 7 | bool _canDrop = true; 8 | private readonly InventoryShape _shape; 9 | 10 | public TestItem(Sprite sprite, InventoryShape shape, bool canDrop) 11 | { 12 | this.sprite = sprite; 13 | _shape = shape; 14 | _canDrop = canDrop; 15 | position = Vector2Int.zero; 16 | } 17 | 18 | public Sprite sprite { get; } 19 | public int width => _shape.width; 20 | public int height => _shape.height; 21 | public Vector2Int position { get; set; } 22 | public bool IsPartOfShape(Vector2Int localPosition) => _shape.IsPartOfShape(localPosition); 23 | public bool canDrop => _canDrop; 24 | } 25 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/TestItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e2309aa1110e4fb48fcb046babc2a96 3 | timeCreated: 1509649636 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/TestProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace FarrokhGames.Inventory 4 | { 5 | public class TestProvider : IInventoryProvider 6 | { 7 | private readonly List _items = new List(); 8 | private readonly int _maximumAlowedItemCount; 9 | 10 | /// 11 | /// CTOR 12 | /// 13 | public TestProvider(InventoryRenderMode renderMode = InventoryRenderMode.Grid, int maximumAlowedItemCount = -1) 14 | { 15 | inventoryRenderMode = renderMode; 16 | _maximumAlowedItemCount = maximumAlowedItemCount; 17 | } 18 | 19 | public int inventoryItemCount => _items.Count; 20 | 21 | public InventoryRenderMode inventoryRenderMode { get; } 22 | 23 | public bool isInventoryFull 24 | { 25 | get 26 | { 27 | if (_maximumAlowedItemCount < 0) return false; 28 | return inventoryItemCount < _maximumAlowedItemCount; 29 | } 30 | } 31 | 32 | public bool AddInventoryItem(IInventoryItem item) 33 | { 34 | if (_items.Contains(item)) return false; 35 | _items.Add(item); 36 | return true; 37 | } 38 | 39 | public bool DropInventoryItem(IInventoryItem item) => RemoveInventoryItem(item); 40 | public IInventoryItem GetInventoryItem(int index) => _items[index]; 41 | public bool CanAddInventoryItem(IInventoryItem item) => true; 42 | public bool CanRemoveInventoryItem(IInventoryItem item) => true; 43 | public bool CanDropInventoryItem(IInventoryItem item) => true; 44 | public bool RemoveInventoryItem(IInventoryItem item) => _items.Remove(item); 45 | } 46 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/Tests/TestProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33e1f70a167694400a62e764d7f8c169 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.farrokhgames.inventory", 3 | "version": "1.0.0", 4 | "displayName": "Inventory", 5 | "description": "A Diablo 2-style inventory system for Unity3D", 6 | "unity": "2019.3", 7 | "unityRelease": "0f6", 8 | "dependencies": {}, 9 | "keywords": [ 10 | "inventory", 11 | "diablo2", 12 | "rpg" 13 | ], 14 | "author": { 15 | "name": "FarrokhGames", 16 | "email": "info@farrokhgames.com", 17 | "url": "https://www.farrokhgames.com" 18 | } 19 | } -------------------------------------------------------------------------------- /Unity Project/Packages/FarrokGames.Inventory/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0755df7b2db1541a8b2775daa8a75e96 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity Project/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.vscode": "1.1.4", 4 | "com.unity.test-framework": "1.1.11", 5 | "com.unity.ugui": "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | m_AutoSimulation: 1 20 | m_AutoSyncTransforms: 1 21 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 20 7 | productGUID: c8f5d51d05f034b13b97bf6920926bc9 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: Unity Project 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosUseCustomAppBackgroundBehavior: 0 56 | iosAllowHTTPDownload: 1 57 | allowedAutorotateToPortrait: 1 58 | allowedAutorotateToPortraitUpsideDown: 1 59 | allowedAutorotateToLandscapeRight: 1 60 | allowedAutorotateToLandscapeLeft: 1 61 | useOSAutorotation: 1 62 | use32BitDisplayBuffer: 1 63 | preserveFramebufferAlpha: 0 64 | disableDepthAndStencilBuffers: 0 65 | androidStartInFullscreen: 1 66 | androidRenderOutsideSafeArea: 1 67 | androidUseSwappy: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 0 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | fullscreenMode: 1 95 | xboxSpeechDB: 0 96 | xboxEnableHeadOrientation: 0 97 | xboxEnableGuest: 0 98 | xboxEnablePIXSampling: 0 99 | metalFramebufferOnly: 0 100 | xboxOneResolution: 0 101 | xboxOneSResolution: 0 102 | xboxOneXResolution: 3 103 | xboxOneMonoLoggingLevel: 0 104 | xboxOneLoggingLevel: 1 105 | xboxOneDisableEsram: 0 106 | xboxOnePresentImmediateThreshold: 0 107 | switchQueueCommandMemory: 0 108 | switchQueueControlMemory: 16384 109 | switchQueueComputeMemory: 262144 110 | switchNVNShaderPoolsGranularity: 33554432 111 | switchNVNDefaultPoolsGranularity: 16777216 112 | switchNVNOtherPoolsGranularity: 16777216 113 | vulkanNumSwapchainBuffers: 3 114 | vulkanEnableSetSRGBWrite: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 0 128 | vrSettings: 129 | cardboard: 130 | depthFormat: 0 131 | enableTransitionView: 0 132 | daydream: 133 | depthFormat: 0 134 | useSustainedPerformanceMode: 0 135 | enableVideoLayer: 0 136 | useProtectedVideoMemory: 0 137 | minimumSupportedHeadTracking: 0 138 | maximumSupportedHeadTracking: 1 139 | hololens: 140 | depthFormat: 1 141 | depthBufferSharingEnabled: 0 142 | lumin: 143 | depthFormat: 0 144 | frameTiming: 2 145 | enableGLCache: 0 146 | glCacheMaxBlobSize: 524288 147 | glCacheMaxFileSize: 8388608 148 | oculus: 149 | sharedDepthBuffer: 0 150 | dashSupport: 0 151 | lowOverheadMode: 0 152 | protectedContext: 0 153 | v2Signing: 1 154 | enable360StereoCapture: 0 155 | isWsaHolographicRemotingEnabled: 0 156 | enableFrameTimingStats: 0 157 | useHDRDisplay: 0 158 | D3DHDRBitDepth: 0 159 | m_ColorGamuts: 00000000 160 | targetPixelDensity: 30 161 | resolutionScalingMode: 0 162 | androidSupportedAspectRatio: 1 163 | androidMaxAspectRatio: 2.1 164 | applicationIdentifier: {} 165 | buildNumber: {} 166 | AndroidBundleVersionCode: 1 167 | AndroidMinSdkVersion: 19 168 | AndroidTargetSdkVersion: 0 169 | AndroidPreferredInstallLocation: 1 170 | aotOptions: 171 | stripEngineCode: 1 172 | iPhoneStrippingLevel: 0 173 | iPhoneScriptCallOptimization: 0 174 | ForceInternetPermission: 0 175 | ForceSDCardPermission: 0 176 | CreateWallpaper: 0 177 | APKExpansionFiles: 0 178 | keepLoadedShadersAlive: 0 179 | StripUnusedMeshComponents: 0 180 | VertexChannelCompressionMask: 214 181 | iPhoneSdkVersion: 988 182 | iOSTargetOSVersionString: 10.0 183 | tvOSSdkVersion: 0 184 | tvOSRequireExtendedGameController: 0 185 | tvOSTargetOSVersionString: 10.0 186 | uIPrerenderedIcon: 0 187 | uIRequiresPersistentWiFi: 0 188 | uIRequiresFullScreen: 1 189 | uIStatusBarHidden: 1 190 | uIExitOnSuspend: 0 191 | uIStatusBarStyle: 0 192 | iPhoneSplashScreen: {fileID: 0} 193 | iPhoneHighResSplashScreen: {fileID: 0} 194 | iPhoneTallHighResSplashScreen: {fileID: 0} 195 | iPhone47inSplashScreen: {fileID: 0} 196 | iPhone55inPortraitSplashScreen: {fileID: 0} 197 | iPhone55inLandscapeSplashScreen: {fileID: 0} 198 | iPhone58inPortraitSplashScreen: {fileID: 0} 199 | iPhone58inLandscapeSplashScreen: {fileID: 0} 200 | iPadPortraitSplashScreen: {fileID: 0} 201 | iPadHighResPortraitSplashScreen: {fileID: 0} 202 | iPadLandscapeSplashScreen: {fileID: 0} 203 | iPadHighResLandscapeSplashScreen: {fileID: 0} 204 | iPhone65inPortraitSplashScreen: {fileID: 0} 205 | iPhone65inLandscapeSplashScreen: {fileID: 0} 206 | iPhone61inPortraitSplashScreen: {fileID: 0} 207 | iPhone61inLandscapeSplashScreen: {fileID: 0} 208 | appleTVSplashScreen: {fileID: 0} 209 | appleTVSplashScreen2x: {fileID: 0} 210 | tvOSSmallIconLayers: [] 211 | tvOSSmallIconLayers2x: [] 212 | tvOSLargeIconLayers: [] 213 | tvOSLargeIconLayers2x: [] 214 | tvOSTopShelfImageLayers: [] 215 | tvOSTopShelfImageLayers2x: [] 216 | tvOSTopShelfImageWideLayers: [] 217 | tvOSTopShelfImageWideLayers2x: [] 218 | iOSLaunchScreenType: 0 219 | iOSLaunchScreenPortrait: {fileID: 0} 220 | iOSLaunchScreenLandscape: {fileID: 0} 221 | iOSLaunchScreenBackgroundColor: 222 | serializedVersion: 2 223 | rgba: 0 224 | iOSLaunchScreenFillPct: 100 225 | iOSLaunchScreenSize: 100 226 | iOSLaunchScreenCustomXibPath: 227 | iOSLaunchScreeniPadType: 0 228 | iOSLaunchScreeniPadImage: {fileID: 0} 229 | iOSLaunchScreeniPadBackgroundColor: 230 | serializedVersion: 2 231 | rgba: 0 232 | iOSLaunchScreeniPadFillPct: 100 233 | iOSLaunchScreeniPadSize: 100 234 | iOSLaunchScreeniPadCustomXibPath: 235 | iOSUseLaunchScreenStoryboard: 0 236 | iOSLaunchScreenCustomStoryboardPath: 237 | iOSDeviceRequirements: [] 238 | iOSURLSchemes: [] 239 | iOSBackgroundModes: 0 240 | iOSMetalForceHardShadows: 0 241 | metalEditorSupport: 0 242 | metalAPIValidation: 1 243 | iOSRenderExtraFrameOnPause: 0 244 | appleDeveloperTeamID: 245 | iOSManualSigningProvisioningProfileID: 246 | tvOSManualSigningProvisioningProfileID: 247 | iOSManualSigningProvisioningProfileType: 0 248 | tvOSManualSigningProvisioningProfileType: 0 249 | appleEnableAutomaticSigning: 0 250 | iOSRequireARKit: 0 251 | iOSAutomaticallyDetectAndAddCapabilities: 1 252 | appleEnableProMotion: 0 253 | clonedFromGUID: 00000000000000000000000000000000 254 | templatePackageId: 255 | templateDefaultScene: 256 | AndroidTargetArchitectures: 5 257 | AndroidSplashScreenScale: 0 258 | androidSplashScreen: {fileID: 0} 259 | AndroidKeystoreName: '{inproject}: ' 260 | AndroidKeyaliasName: 261 | AndroidBuildApkPerCpuArchitecture: 0 262 | AndroidTVCompatibility: 1 263 | AndroidIsGame: 1 264 | AndroidEnableTango: 0 265 | androidEnableBanner: 1 266 | androidUseLowAccuracyLocation: 0 267 | androidUseCustomKeystore: 0 268 | m_AndroidBanners: 269 | - width: 320 270 | height: 180 271 | banner: {fileID: 0} 272 | androidGamepadSupportLevel: 0 273 | AndroidValidateAppBundleSize: 1 274 | AndroidAppBundleSizeToValidate: 150 275 | m_BuildTargetIcons: [] 276 | m_BuildTargetPlatformIcons: [] 277 | m_BuildTargetBatching: [] 278 | m_BuildTargetGraphicsJobs: 279 | - m_BuildTarget: MacStandaloneSupport 280 | m_GraphicsJobs: 0 281 | - m_BuildTarget: Switch 282 | m_GraphicsJobs: 0 283 | - m_BuildTarget: MetroSupport 284 | m_GraphicsJobs: 0 285 | - m_BuildTarget: AppleTVSupport 286 | m_GraphicsJobs: 0 287 | - m_BuildTarget: BJMSupport 288 | m_GraphicsJobs: 0 289 | - m_BuildTarget: LinuxStandaloneSupport 290 | m_GraphicsJobs: 0 291 | - m_BuildTarget: PS4Player 292 | m_GraphicsJobs: 0 293 | - m_BuildTarget: iOSSupport 294 | m_GraphicsJobs: 0 295 | - m_BuildTarget: WindowsStandaloneSupport 296 | m_GraphicsJobs: 0 297 | - m_BuildTarget: XboxOnePlayer 298 | m_GraphicsJobs: 0 299 | - m_BuildTarget: LuminSupport 300 | m_GraphicsJobs: 0 301 | - m_BuildTarget: AndroidPlayer 302 | m_GraphicsJobs: 0 303 | - m_BuildTarget: WebGLSupport 304 | m_GraphicsJobs: 0 305 | m_BuildTargetGraphicsJobMode: 306 | - m_BuildTarget: PS4Player 307 | m_GraphicsJobMode: 0 308 | - m_BuildTarget: XboxOnePlayer 309 | m_GraphicsJobMode: 0 310 | m_BuildTargetGraphicsAPIs: [] 311 | m_BuildTargetVRSettings: [] 312 | openGLRequireES31: 0 313 | openGLRequireES31AEP: 0 314 | openGLRequireES32: 0 315 | m_TemplateCustomTags: {} 316 | mobileMTRendering: 317 | Android: 1 318 | iPhone: 1 319 | tvOS: 1 320 | m_BuildTargetGroupLightmapEncodingQuality: 321 | - m_BuildTarget: Standalone 322 | m_EncodingQuality: 1 323 | - m_BuildTarget: XboxOne 324 | m_EncodingQuality: 1 325 | - m_BuildTarget: PS4 326 | m_EncodingQuality: 1 327 | m_BuildTargetGroupLightmapSettings: [] 328 | playModeTestRunnerEnabled: 0 329 | runPlayModeTestAsEditModeTest: 0 330 | actionOnDotNetUnhandledException: 1 331 | enableInternalProfiler: 0 332 | logObjCUncaughtExceptions: 1 333 | enableCrashReportAPI: 0 334 | cameraUsageDescription: 335 | locationUsageDescription: 336 | microphoneUsageDescription: 337 | switchNetLibKey: 338 | switchSocketMemoryPoolSize: 6144 339 | switchSocketAllocatorPoolSize: 128 340 | switchSocketConcurrencyLimit: 14 341 | switchScreenResolutionBehavior: 2 342 | switchUseCPUProfiler: 0 343 | switchApplicationID: 0x01004b9000490000 344 | switchNSODependencies: 345 | switchTitleNames_0: 346 | switchTitleNames_1: 347 | switchTitleNames_2: 348 | switchTitleNames_3: 349 | switchTitleNames_4: 350 | switchTitleNames_5: 351 | switchTitleNames_6: 352 | switchTitleNames_7: 353 | switchTitleNames_8: 354 | switchTitleNames_9: 355 | switchTitleNames_10: 356 | switchTitleNames_11: 357 | switchTitleNames_12: 358 | switchTitleNames_13: 359 | switchTitleNames_14: 360 | switchPublisherNames_0: 361 | switchPublisherNames_1: 362 | switchPublisherNames_2: 363 | switchPublisherNames_3: 364 | switchPublisherNames_4: 365 | switchPublisherNames_5: 366 | switchPublisherNames_6: 367 | switchPublisherNames_7: 368 | switchPublisherNames_8: 369 | switchPublisherNames_9: 370 | switchPublisherNames_10: 371 | switchPublisherNames_11: 372 | switchPublisherNames_12: 373 | switchPublisherNames_13: 374 | switchPublisherNames_14: 375 | switchIcons_0: {fileID: 0} 376 | switchIcons_1: {fileID: 0} 377 | switchIcons_2: {fileID: 0} 378 | switchIcons_3: {fileID: 0} 379 | switchIcons_4: {fileID: 0} 380 | switchIcons_5: {fileID: 0} 381 | switchIcons_6: {fileID: 0} 382 | switchIcons_7: {fileID: 0} 383 | switchIcons_8: {fileID: 0} 384 | switchIcons_9: {fileID: 0} 385 | switchIcons_10: {fileID: 0} 386 | switchIcons_11: {fileID: 0} 387 | switchIcons_12: {fileID: 0} 388 | switchIcons_13: {fileID: 0} 389 | switchIcons_14: {fileID: 0} 390 | switchSmallIcons_0: {fileID: 0} 391 | switchSmallIcons_1: {fileID: 0} 392 | switchSmallIcons_2: {fileID: 0} 393 | switchSmallIcons_3: {fileID: 0} 394 | switchSmallIcons_4: {fileID: 0} 395 | switchSmallIcons_5: {fileID: 0} 396 | switchSmallIcons_6: {fileID: 0} 397 | switchSmallIcons_7: {fileID: 0} 398 | switchSmallIcons_8: {fileID: 0} 399 | switchSmallIcons_9: {fileID: 0} 400 | switchSmallIcons_10: {fileID: 0} 401 | switchSmallIcons_11: {fileID: 0} 402 | switchSmallIcons_12: {fileID: 0} 403 | switchSmallIcons_13: {fileID: 0} 404 | switchSmallIcons_14: {fileID: 0} 405 | switchManualHTML: 406 | switchAccessibleURLs: 407 | switchLegalInformation: 408 | switchMainThreadStackSize: 1048576 409 | switchPresenceGroupId: 410 | switchLogoHandling: 0 411 | switchReleaseVersion: 0 412 | switchDisplayVersion: 1.0.0 413 | switchStartupUserAccount: 0 414 | switchTouchScreenUsage: 0 415 | switchSupportedLanguagesMask: 0 416 | switchLogoType: 0 417 | switchApplicationErrorCodeCategory: 418 | switchUserAccountSaveDataSize: 0 419 | switchUserAccountSaveDataJournalSize: 0 420 | switchApplicationAttribute: 0 421 | switchCardSpecSize: -1 422 | switchCardSpecClock: -1 423 | switchRatingsMask: 0 424 | switchRatingsInt_0: 0 425 | switchRatingsInt_1: 0 426 | switchRatingsInt_2: 0 427 | switchRatingsInt_3: 0 428 | switchRatingsInt_4: 0 429 | switchRatingsInt_5: 0 430 | switchRatingsInt_6: 0 431 | switchRatingsInt_7: 0 432 | switchRatingsInt_8: 0 433 | switchRatingsInt_9: 0 434 | switchRatingsInt_10: 0 435 | switchRatingsInt_11: 0 436 | switchRatingsInt_12: 0 437 | switchLocalCommunicationIds_0: 438 | switchLocalCommunicationIds_1: 439 | switchLocalCommunicationIds_2: 440 | switchLocalCommunicationIds_3: 441 | switchLocalCommunicationIds_4: 442 | switchLocalCommunicationIds_5: 443 | switchLocalCommunicationIds_6: 444 | switchLocalCommunicationIds_7: 445 | switchParentalControl: 0 446 | switchAllowsScreenshot: 1 447 | switchAllowsVideoCapturing: 1 448 | switchAllowsRuntimeAddOnContentInstall: 0 449 | switchDataLossConfirmation: 0 450 | switchUserAccountLockEnabled: 0 451 | switchSystemResourceMemory: 16777216 452 | switchSupportedNpadStyles: 3 453 | switchNativeFsCacheSize: 32 454 | switchIsHoldTypeHorizontal: 0 455 | switchSupportedNpadCount: 8 456 | switchSocketConfigEnabled: 0 457 | switchTcpInitialSendBufferSize: 32 458 | switchTcpInitialReceiveBufferSize: 64 459 | switchTcpAutoSendBufferSizeMax: 256 460 | switchTcpAutoReceiveBufferSizeMax: 256 461 | switchUdpSendBufferSize: 9 462 | switchUdpReceiveBufferSize: 42 463 | switchSocketBufferEfficiency: 4 464 | switchSocketInitializeEnabled: 1 465 | switchNetworkInterfaceManagerInitializeEnabled: 1 466 | switchPlayerConnectionEnabled: 1 467 | ps4NPAgeRating: 12 468 | ps4NPTitleSecret: 469 | ps4NPTrophyPackPath: 470 | ps4ParentalLevel: 11 471 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 472 | ps4Category: 0 473 | ps4MasterVersion: 01.00 474 | ps4AppVersion: 01.00 475 | ps4AppType: 0 476 | ps4ParamSfxPath: 477 | ps4VideoOutPixelFormat: 0 478 | ps4VideoOutInitialWidth: 1920 479 | ps4VideoOutBaseModeInitialWidth: 1920 480 | ps4VideoOutReprojectionRate: 60 481 | ps4PronunciationXMLPath: 482 | ps4PronunciationSIGPath: 483 | ps4BackgroundImagePath: 484 | ps4StartupImagePath: 485 | ps4StartupImagesFolder: 486 | ps4IconImagesFolder: 487 | ps4SaveDataImagePath: 488 | ps4SdkOverride: 489 | ps4BGMPath: 490 | ps4ShareFilePath: 491 | ps4ShareOverlayImagePath: 492 | ps4PrivacyGuardImagePath: 493 | ps4NPtitleDatPath: 494 | ps4RemotePlayKeyAssignment: -1 495 | ps4RemotePlayKeyMappingDir: 496 | ps4PlayTogetherPlayerCount: 0 497 | ps4EnterButtonAssignment: 1 498 | ps4ApplicationParam1: 0 499 | ps4ApplicationParam2: 0 500 | ps4ApplicationParam3: 0 501 | ps4ApplicationParam4: 0 502 | ps4DownloadDataSize: 0 503 | ps4GarlicHeapSize: 2048 504 | ps4ProGarlicHeapSize: 2560 505 | playerPrefsMaxSize: 32768 506 | ps4Passcode: 5PN2qmWqBlQ9wQj99nsQzldVI5ZuGXbE 507 | ps4pnSessions: 1 508 | ps4pnPresence: 1 509 | ps4pnFriends: 1 510 | ps4pnGameCustomData: 1 511 | playerPrefsSupport: 0 512 | enableApplicationExit: 0 513 | resetTempFolder: 1 514 | restrictedAudioUsageRights: 0 515 | ps4UseResolutionFallback: 0 516 | ps4ReprojectionSupport: 0 517 | ps4UseAudio3dBackend: 0 518 | ps4SocialScreenEnabled: 0 519 | ps4ScriptOptimizationLevel: 0 520 | ps4Audio3dVirtualSpeakerCount: 14 521 | ps4attribCpuUsage: 0 522 | ps4PatchPkgPath: 523 | ps4PatchLatestPkgPath: 524 | ps4PatchChangeinfoPath: 525 | ps4PatchDayOne: 0 526 | ps4attribUserManagement: 0 527 | ps4attribMoveSupport: 0 528 | ps4attrib3DSupport: 0 529 | ps4attribShareSupport: 0 530 | ps4attribExclusiveVR: 0 531 | ps4disableAutoHideSplash: 0 532 | ps4videoRecordingFeaturesUsed: 0 533 | ps4contentSearchFeaturesUsed: 0 534 | ps4attribEyeToEyeDistanceSettingVR: 0 535 | ps4IncludedModules: [] 536 | ps4attribVROutputEnabled: 0 537 | monoEnv: 538 | splashScreenBackgroundSourceLandscape: {fileID: 0} 539 | splashScreenBackgroundSourcePortrait: {fileID: 0} 540 | blurSplashScreenBackground: 1 541 | spritePackerPolicy: 542 | webGLMemorySize: 256 543 | webGLExceptionSupport: 1 544 | webGLNameFilesAsHashes: 0 545 | webGLDataCaching: 0 546 | webGLDebugSymbols: 0 547 | webGLEmscriptenArgs: 548 | webGLModulesDirectory: 549 | webGLTemplate: APPLICATION:Default 550 | webGLAnalyzeBuildSize: 0 551 | webGLUseEmbeddedResources: 0 552 | webGLCompressionFormat: 1 553 | webGLLinkerTarget: 1 554 | webGLThreadsSupport: 0 555 | webGLWasmStreaming: 0 556 | scriptingDefineSymbols: {} 557 | platformArchitecture: {} 558 | scriptingBackend: {} 559 | il2cppCompilerConfiguration: {} 560 | managedStrippingLevel: {} 561 | incrementalIl2cppBuild: {} 562 | allowUnsafeCode: 0 563 | additionalIl2CppArgs: 564 | scriptingRuntimeVersion: 1 565 | gcIncremental: 0 566 | gcWBarrierValidation: 0 567 | apiCompatibilityLevelPerPlatform: {} 568 | m_RenderingPath: 1 569 | m_MobileRenderingPath: 1 570 | metroPackageName: Unity Project 571 | metroPackageVersion: 572 | metroCertificatePath: 573 | metroCertificatePassword: 574 | metroCertificateSubject: 575 | metroCertificateIssuer: 576 | metroCertificateNotAfter: 0000000000000000 577 | metroApplicationDescription: Unity Project 578 | wsaImages: {} 579 | metroTileShortName: 580 | metroTileShowName: 0 581 | metroMediumTileShowName: 0 582 | metroLargeTileShowName: 0 583 | metroWideTileShowName: 0 584 | metroSupportStreamingInstall: 0 585 | metroLastRequiredScene: 0 586 | metroDefaultTileSize: 1 587 | metroTileForegroundText: 2 588 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 589 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 590 | a: 1} 591 | metroSplashScreenUseBackgroundColor: 0 592 | platformCapabilities: {} 593 | metroTargetDeviceFamilies: {} 594 | metroFTAName: 595 | metroFTAFileTypes: [] 596 | metroProtocolName: 597 | XboxOneProductId: 598 | XboxOneUpdateKey: 599 | XboxOneSandboxId: 600 | XboxOneContentId: 601 | XboxOneTitleId: 602 | XboxOneSCId: 603 | XboxOneGameOsOverridePath: 604 | XboxOnePackagingOverridePath: 605 | XboxOneAppManifestOverridePath: 606 | XboxOneVersion: 1.0.0.0 607 | XboxOnePackageEncryption: 0 608 | XboxOnePackageUpdateGranularity: 2 609 | XboxOneDescription: 610 | XboxOneLanguage: 611 | - enus 612 | XboxOneCapability: [] 613 | XboxOneGameRating: {} 614 | XboxOneIsContentPackage: 0 615 | XboxOneEnableGPUVariability: 0 616 | XboxOneSockets: {} 617 | XboxOneSplashScreen: {fileID: 0} 618 | XboxOneAllowedProductIds: [] 619 | XboxOnePersistentLocalStorageSize: 0 620 | XboxOneXTitleMemory: 8 621 | XboxOneOverrideIdentityName: 622 | vrEditorSettings: 623 | daydream: 624 | daydreamIconForeground: {fileID: 0} 625 | daydreamIconBackground: {fileID: 0} 626 | cloudServicesEnabled: {} 627 | luminIcon: 628 | m_Name: 629 | m_ModelFolderPath: 630 | m_PortalFolderPath: 631 | luminCert: 632 | m_CertPath: 633 | m_SignPackage: 1 634 | luminIsChannelApp: 0 635 | luminVersion: 636 | m_VersionCode: 1 637 | m_VersionName: 638 | apiCompatibilityLevel: 6 639 | cloudProjectId: 640 | framebufferDepthMemorylessMode: 0 641 | projectName: 642 | organizationId: 643 | cloudEnabled: 0 644 | enableNativePlatformBackendsForNewInputSystem: 0 645 | disableOldInputManagerSupport: 0 646 | legacyClampBlendShapeWeights: 1 647 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.3.0f6 2 | m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf) 3 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 2 136 | antiAliasing: 2 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Samsung TV: 2 185 | Standalone: 5 186 | Tizen: 2 187 | WebGL: 3 188 | WiiU: 5 189 | Windows Store Apps: 5 190 | XboxOne: 5 191 | iPhone: 2 192 | tvOS: 2 193 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Unity Project/ProjectSettings/editorsettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref;asmdef 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | --------------------------------------------------------------------------------