Having Trouble With Turn Base Strategy Grid
I'm working on a project right now, and it basically plays (or at least is plan to play) like Nintendo's Fire Emblem games. I am tasked with making to grid that the characters will move on. The grid needs to be editable so there can be different tile types (normal, dense cover, unpassable, etc). Right now I have these two scripts:
Tile
using UnityEngine;
using System.Collections;
public class Tile : MonoBehaviour {
public TileTypes TerrainType;
public Vector2 GridPos;
// Use this for initialization
public void Init (int Xpos, int Ypos)
{
GridPos = new Vector2(Xpos, Ypos);
}
// Update is called once per frame
void Update () {
}
}
Map
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MapManager : MonoBehaviour {
public int MapWidth;
public int MapHeight;
public List<Tile> Tiles;
// Use this for initialization
void Awake ()
{
GameObject[] TilesObj = GameObject.FindGameObjectsWithTag("Tile");
foreach (GameObject tile in TilesObj)
Tiles.Add(tile.GetComponent<Tile>());
int TilePlace = 0;
for (int i = 0; i < MapHeight; i++)
{
for (int j = 0; j < MapWidth; j++)
{
Tiles[TilePlace].Init(j, i);
TilePlace++;
}
}
}
// Update is called once per frame
void Update () {
}
}
The problem with this is that the map can't order the tiles correctly. For example with a 6x6 grid the tiles are in random orders. Starting from the bottom right I have 0,4 3,5, 2,3.... Also making tiles across the level would be tedious (I've been told). So what would be the best way to go about this? Oh and I can't use anything from the asset store.
TL;DR
How Do I make Nintendo's Fire Emblem (The Grid Part).
Thank You