mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-24 02:11:07 +00:00
21 lines
599 B
C#
21 lines
599 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class BuildZombie: MonoBehaviour {
|
|
private GameObject[] Grid;
|
|
public GameObject zombieHouse;
|
|
private Stats stats;
|
|
public void onClick()
|
|
{
|
|
stats = GameObject.Find("Stats").gameObject.GetComponent<Stats>();
|
|
if (stats.AmountOfCorpse >= 6) {
|
|
stats.removeCorpse(6);
|
|
stats.AmountZombieHouse++;
|
|
Grid = GameObject.FindGameObjectsWithTag ("Zombie");
|
|
Instantiate (zombieHouse, Grid[Grid.Length-1].transform.position, Grid[Grid.Length-1].transform.rotation);
|
|
DestroyObject (Grid[Grid.Length-1]);
|
|
stats.displayStats();
|
|
}
|
|
}
|
|
}
|