mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-26 11:21:06 +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 class ConstructionBehaviour : MonoBehaviour {
|
||||||
|
|
||||||
public int ConstructionType;
|
public int ConstructionType =-1 ;
|
||||||
public GameObject maisonHumain;
|
public GameObject maisonHumain;
|
||||||
public GameObject maisonZombie;
|
public GameObject maisonZombie;
|
||||||
public GameObject champ;
|
public GameObject champ;
|
||||||
@ -11,6 +11,7 @@ public class ConstructionBehaviour : MonoBehaviour {
|
|||||||
|
|
||||||
void OnMouseDown()
|
void OnMouseDown()
|
||||||
{
|
{
|
||||||
|
int.TryParse(Input.inputString, out ConstructionType);
|
||||||
switch (ConstructionType) {
|
switch (ConstructionType) {
|
||||||
case 1:
|
case 1:
|
||||||
SwitchPrefab = maisonHumain;
|
SwitchPrefab = maisonHumain;
|
||||||
@ -22,14 +23,16 @@ public class ConstructionBehaviour : MonoBehaviour {
|
|||||||
SwitchPrefab = maisonZombie;
|
SwitchPrefab = maisonZombie;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SwitchPrefab = maisonHumain;
|
SwitchPrefab = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switchPrefab ();
|
switchPrefab ();
|
||||||
}
|
}
|
||||||
void switchPrefab()
|
void switchPrefab()
|
||||||
{
|
{
|
||||||
Instantiate (SwitchPrefab, this.gameObject.transform.position, this.gameObject.transform.rotation);
|
if (SwitchPrefab != null) {
|
||||||
DestroyObject (this.gameObject);
|
Instantiate (SwitchPrefab, this.gameObject.transform.position, this.gameObject.transform.rotation);
|
||||||
|
DestroyObject (this.gameObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user