void Wander() { if (mov.GetTargetCount() == 0) { TerrainBoard.SetColor(goalGrid.x, goalGrid.y, Color.white); SelectTarget(); goalGrid = TerrainBoard.transformPositionToGrid(pos + dir); if (!TerrainBoard.map.InBound(goalGrid)) { return; } TerrainBoard.SetColor(goalGrid.x, goalGrid.y, Color.red); mov.ResetTarget(Search(pos, pos + dir)); } }