mirror of
				https://github.com/DerTyp7/fps-citybuild-unity.git
				synced 2025-10-31 05:07:08 +01:00 
			
		
		
		
	Added Basic ResourceManagement
This commit is contained in:
		
							
								
								
									
										32
									
								
								Assets/Scripts/Building/Buildings/House/HouseBlueprint.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								Assets/Scripts/Building/Buildings/House/HouseBlueprint.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class HouseBlueprint : BuildingBlueprint | ||||
| { | ||||
|      | ||||
|     public Material collisionMat; | ||||
|     public Material blueprintMat; | ||||
|  | ||||
|  | ||||
|     private Transform houseCube; | ||||
|  | ||||
|     public override void Init() | ||||
|     { | ||||
|         //Haus cube <20>m Obj -> hier wird es benutzt zum material <20>ndern | ||||
|         houseCube = gameObject.transform.Find("HouseCube"); | ||||
|     } | ||||
|  | ||||
|     public override void WhileColliding() | ||||
|     {         | ||||
|         //Wenn es collidet soll der HouseCube IM Object ver<65>ndert werden! | ||||
|         //Das ist bei jedem Building anders | ||||
|         houseCube.GetComponent<MeshRenderer>().material = collisionMat; | ||||
|     } | ||||
|  | ||||
|     public override void WhileNotColliding() | ||||
|     { | ||||
|         //Das selbe wie bei "WhileColliding" | ||||
|         houseCube.GetComponent<MeshRenderer>().material = blueprintMat; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187