mirror of
				https://github.com/DerTyp7/fps-citybuild-unity.git
				synced 2025-10-31 05:07:08 +01:00 
			
		
		
		
	started working on Building rework
This commit is contained in:
		
							
								
								
									
										26
									
								
								Assets/Buildings/Scripts/BuildingConstruction.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Assets/Buildings/Scripts/BuildingConstruction.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public abstract class BuildingConstruction : MonoBehaviour | ||||
| { | ||||
|  | ||||
|     public GameObject building; | ||||
|  | ||||
|     public abstract bool CheckForResources(); | ||||
|     public abstract void Init(); | ||||
|  | ||||
|     private void Start() | ||||
|     { | ||||
|         Init(); | ||||
|     } | ||||
|  | ||||
|     private void Update() | ||||
|     { | ||||
|         if (CheckForResources()) | ||||
|         { | ||||
|             Instantiate(building, gameObject.transform.position, Quaternion.identity); | ||||
|             Destroy(this.gameObject); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187