mirror of
				https://github.com/DerTyp7/fps-citybuild-unity.git
				synced 2025-11-03 22:18:58 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			527 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			527 B
		
	
	
	
		
			C#
		
	
	
	
	
	
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);
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |