mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-24 02:11:07 +00:00
Modif scene Antoine
This commit is contained in:
parent
29352dba1b
commit
2911b3aaf3
@ -3,7 +3,7 @@ using System.Collections;
|
||||
|
||||
public class ConstructionBehaviour : MonoBehaviour {
|
||||
|
||||
public int ConstructionType;
|
||||
public int ConstructionType =-1 ;
|
||||
public GameObject maisonHumain;
|
||||
public GameObject maisonZombie;
|
||||
public GameObject champ;
|
||||
@ -11,6 +11,7 @@ public class ConstructionBehaviour : MonoBehaviour {
|
||||
|
||||
void OnMouseDown()
|
||||
{
|
||||
int.TryParse(Input.inputString, out ConstructionType);
|
||||
switch (ConstructionType) {
|
||||
case 1:
|
||||
SwitchPrefab = maisonHumain;
|
||||
@ -22,14 +23,16 @@ public class ConstructionBehaviour : MonoBehaviour {
|
||||
SwitchPrefab = maisonZombie;
|
||||
break;
|
||||
default:
|
||||
SwitchPrefab = maisonHumain;
|
||||
SwitchPrefab = null;
|
||||
break;
|
||||
}
|
||||
switchPrefab ();
|
||||
}
|
||||
void switchPrefab()
|
||||
{
|
||||
if (SwitchPrefab != null) {
|
||||
Instantiate (SwitchPrefab, this.gameObject.transform.position, this.gameObject.transform.rotation);
|
||||
DestroyObject (this.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user