// Update is called once per frame void Update() { if (s) { s = false; int[] copy = new int[playersToAdd.Count]; playersToAdd.CopyTo(copy); foreach (int i in copy) { playersToAdd.Remove(i); if (playersAlreadyInGame.Contains(i)) { continue; } playersAlreadyInGame.Add(i); Debug.Log("asked to add " + i); MapGridCreation mgc = GameObject.Find("MapManager").GetComponent <MapGridCreation>(); if (i + "" == (string)Coffre.Regarder("id")) { mgc.AddPlayer(i, false); } else { Debug.Log("Adding multi player: " + i); mgc.AddMultiPlayer(i); } } } }
private Transform InstantiateDeco(int x, int y, SimpleDecoration deco) { MapGridCreation script = transform.parent.GetComponent <MapGridCreation>(); Transform o = Instantiate(SimpleDeco, new Vector3(x, y, 0), Quaternion.identity, transform); o.GetComponent <SimpleDeco>().Create(deco); script.AddToInstance(y, x, true, !deco.AsCol); return(o); }
public void Create(RoomData roomData, int prob) { _roomData = roomData; _prob = prob; script = transform.parent.GetComponent <MapGridCreation>(); }