Skip to content
Snippets Groups Projects
Commit 25fdbe13 authored by v.bloch's avatar v.bloch
Browse files

Merge branch 'master' of git.unistra.fr:chirz/cityescape

parents 22be36e3 e1dbafdf
Branches
No related merge requests found
...@@ -6,6 +6,11 @@ public class GenerateMap : MonoBehaviour ...@@ -6,6 +6,11 @@ public class GenerateMap : MonoBehaviour
{ {
//Les 8 prefabs //Les 8 prefabs
public GameObject[] maps = new GameObject[8]; public GameObject[] maps = new GameObject[8];
public GameObject[] shopFactory = new GameObject[8];
public Object[] objects=new Object[8];
public int where;
//Les coordonées x dans l'ordre //Les coordonées x dans l'ordre
private int[] xs=new int[]{-17,0,17,-17,0,17,-17,0}; private int[] xs=new int[]{-17,0,17,-17,0,17,-17,0};
...@@ -23,11 +28,17 @@ public class GenerateMap : MonoBehaviour ...@@ -23,11 +28,17 @@ public class GenerateMap : MonoBehaviour
{ {
for(int i=0;i<8;i++) for(int i=0;i<8;i++)
{ {
Instantiate(maps[i], new Vector3(xs[i], ys[i], 0), Quaternion.identity); objects[i]=Instantiate(maps[i], new Vector3(xs[i], ys[i], 0), Quaternion.identity);
} }
} }
public void generateShopFactory()
{
Destroy(objects[where]);
Instantiate(shopFactory[where], new Vector3(xs[where], ys[where], 0), Quaternion.identity);
}
void Update() void Update()
{ {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment