private IEnumerator Start() { players = FindObjectsOfType <Player>().Where(x => x != this).ToList(); yield return(new WaitForSeconds(1f)); var sw = new System.Diagnostics.Stopwatch(); sw.Start(); if (aStar) { var aNodePath = APathfinding.FindPath(transform.position, target.position); sw.Stop(); if (aNodePath != null) { path = aNodePath.Select(x => x.worldPosition).ToList(); } } else { var dNodePath = DPathfinding.FindPath(transform.position, target.position); sw.Stop(); if (dNodePath != null) { path = dNodePath.Select(x => x.worldPosition).ToList(); } } Debug.Log(sw.Elapsed.Milliseconds); if (path != null) { currentIdx = 0; isMoving = true; } }
public void StartGen() { D = new DPathfinding(); Setup(); WightMap(); D.setup(); CoastLines(); WmapUpdate(); FillPlains(); Montain(); WmapUpdate(); Lake(); WmapUpdate(); Rivers(); WmapUpdate(); Grassland(); WmapUpdate(); Forest(); WmapUpdate(); Hills(); WmapUpdate(); Desert(); //cleanup HoleFix(); WmapUpdate(); TextureCorrector(); //Set tile to there correct texture }