mirror of
				https://github.com/DerTyp7/fps-citybuild-unity.git
				synced 2025-10-31 05:07:08 +01:00 
			
		
		
		
	Added Warehouse
This commit is contained in:
		| @@ -0,0 +1,34 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class WarehouseBlueprint : BuildingBlueprint | ||||
| { | ||||
|     private MeshRenderer[] childrenMeshRenderer; | ||||
|  | ||||
|     public override void Init() | ||||
|     { | ||||
|         //Haus cube <20>m Obj -> hier wird es benutzt zum material <20>ndern | ||||
|         childrenMeshRenderer = gameObject.GetComponentsInChildren<MeshRenderer>(); | ||||
|     } | ||||
|  | ||||
|     public override void WhileColliding() | ||||
|     { | ||||
|         //Wenn es collidet soll der HouseCube IM Object ver<65>ndert werden! | ||||
|         //Das ist bei jedem Building anders | ||||
|         foreach(MeshRenderer r in childrenMeshRenderer) | ||||
|         { | ||||
|             r.material = collisionMat; | ||||
|         } | ||||
|          | ||||
|     } | ||||
|  | ||||
|     public override void WhileNotColliding() | ||||
|     { | ||||
|         //Das selbe wie bei "WhileColliding" | ||||
|         foreach (MeshRenderer r in childrenMeshRenderer) | ||||
|         { | ||||
|             r.material = blueprintMat; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c08df78a8e2e51d4c80019a27fc2cc5c | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
| @@ -7,6 +7,8 @@ public class WarehouseBuilding : StorageBuilding | ||||
|  | ||||
|     private void Start() | ||||
|     { | ||||
|         title = "Warehouse"; | ||||
|         description = "A place to store your resources"; | ||||
|         inventorySpace = 500; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,25 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class WarehouseConstruction : BuildingConstruction | ||||
| { | ||||
|     [Header("Needed Resources")] | ||||
|     [SerializeField] private int neededWood = 10; | ||||
|  | ||||
|     [Header("Having Resources")] | ||||
|     [SerializeField] private int havingWood = 0; | ||||
|  | ||||
|     public override void Init() | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public override bool CheckForResources() | ||||
|     { | ||||
|         if (havingWood == neededWood) | ||||
|         { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c290e17b16e818841aabd5083a3475db | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187