mirror of
				https://github.com/DerTyp7/fps-citybuild-unity.git
				synced 2025-10-31 21:27:06 +01:00 
			
		
		
		
	Item Scriptable Object, Basic Resource Manager
This commit is contained in:
		
							
								
								
									
										14
									
								
								Assets/Scripts/Resources/Scripts/Item.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Assets/Scripts/Resources/Scripts/Item.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| [CreateAssetMenu(fileName = "New Item", menuName = "Resources/Item")] | ||||
| public class Item : ScriptableObject | ||||
| { | ||||
|     new public string name = "New Item"; | ||||
|     public string uuid = "new_item"; | ||||
|     public Sprite icon = null; | ||||
|     public bool isDefaultItem = false; | ||||
|  | ||||
|      | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/Scripts/Resources/Scripts/Item.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/Resources/Scripts/Item.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 232c60ba7df6f074d9c92fa97215e412 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										19
									
								
								Assets/Scripts/Resources/Scripts/ResourceManager.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								Assets/Scripts/Resources/Scripts/ResourceManager.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class ResourceManager: MonoBehaviour | ||||
| { | ||||
|     [SerializeField] private List<Item> itemList; | ||||
|  | ||||
|     public void Remove(Item item) | ||||
|     { | ||||
|         itemList.Remove(item); | ||||
|     } | ||||
|      | ||||
|     public void Add(Item item) | ||||
|     { | ||||
|         itemList.Add(item); | ||||
|     } | ||||
|  | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/Scripts/Resources/Scripts/ResourceManager.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/Resources/Scripts/ResourceManager.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 241231c1be475704d8a3fded0c1a9d63 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187