void Start () {
if (FindObjectsOfType(typeof(TileHandlerHelper)).Length > 1) {
Debug.LogError ("There should only be one TileHandlerHelper per scene. Destroying.");
Destroy (this);
return;
}
if (handler == null) {
if (AstarPath.active == null || AstarPath.active.astarData.recastGraph == null) {
Debug.LogWarning ("No AstarPath object in the scene or no RecastGraph on that AstarPath object");
}
handler = new TileHandler(AstarPath.active.astarData.recastGraph);
handler.CreateTileTypesFromGraph();
}
}