mirror of
				https://github.com/DerTyp7/industrialize-unity.git
				synced 2025-10-31 05:17:10 +01:00 
			
		
		
		
	conveyor placement rework
This commit is contained in:
		| @@ -126,7 +126,7 @@ public class Pathfinding | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     private List<PathNode> GetNeighbourList(PathNode currentNode) | ||||
|     public List<PathNode> GetNeighbourList(PathNode currentNode) | ||||
|     { | ||||
|         List<PathNode> neighbourList = new List<PathNode>(); | ||||
|  | ||||
| @@ -175,6 +175,14 @@ public class Pathfinding | ||||
|         return path; | ||||
|     } | ||||
|  | ||||
|     public int CalculateDistance(PathNode a, PathNode b) | ||||
|     { | ||||
|         int xDistance = Mathf.Abs(a.x - b.x); | ||||
|         int yDistance = Mathf.Abs(a.y - b.y); | ||||
|         int remaining = Mathf.Abs(xDistance - yDistance); | ||||
|         return Mathf.Min(xDistance, yDistance) + remaining; | ||||
|     } | ||||
|  | ||||
|     private int CalculateDistanceCost(PathNode a, PathNode b) | ||||
|     { | ||||
|         int xDistance = Mathf.Abs(a.x - b.x); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Janis
					Janis