mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-24 02:11:07 +00:00
36 lines
707 B
C#
36 lines
707 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class ConstructionBehaviour : MonoBehaviour {
|
|
|
|
public int ConstructionType;
|
|
public GameObject maisonHumain;
|
|
public GameObject maisonZombie;
|
|
public GameObject champ;
|
|
private GameObject SwitchPrefab;
|
|
|
|
void OnMouseDown()
|
|
{
|
|
switch (ConstructionType) {
|
|
case 1:
|
|
SwitchPrefab = maisonHumain;
|
|
break;
|
|
case 2:
|
|
SwitchPrefab = champ;
|
|
break;
|
|
case 3:
|
|
SwitchPrefab = maisonZombie;
|
|
break;
|
|
default:
|
|
SwitchPrefab = maisonHumain;
|
|
break;
|
|
}
|
|
switchPrefab ();
|
|
}
|
|
void switchPrefab()
|
|
{
|
|
Instantiate (SwitchPrefab, this.gameObject.transform.position, this.gameObject.transform.rotation);
|
|
DestroyObject (this.gameObject);
|
|
}
|
|
}
|