// Remove todas as instâncias de marcador do cenário public void ClearInstances(TileManager.MarkerEnum tile) { foreach (Transform child in tileLayers[(int)tile]) { Destroy(child.gameObject); } }
// Instancia marcador no cenário public void InstantiateTile(Vector2Int pos, TileManager.MarkerEnum tile) { GameObject entityPosPath = Instantiate(tilePrefabs[(int)tile], new Vector3(pos.x + map.centerOffset, 1f + (((int)tile) + 1) / 1000f, pos.y + map.centerOffset), Quaternion.identity); entityPosPath.transform.SetParent(tileLayers[(int)tile]); entityPosPath.GetComponent <PathCoord>().coord = pos; entityPosPath.name = pos.x + "," + pos.y; entityPosPath.SetActive(true); }