mirror of
https://github.com/DerTyp7/industrialize-unity.git
synced 2026-07-31 19:29:03 +02:00
CameraMovement
This commit is contained in:
39
Assets/Scripts/Pathfinding/PathNode.cs
Normal file
39
Assets/Scripts/Pathfinding/PathNode.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PathNode {
|
||||
|
||||
private Grid<PathNode> grid;
|
||||
public int x;
|
||||
public int y;
|
||||
|
||||
public int gCost;
|
||||
public int hCost;
|
||||
public int fCost;
|
||||
|
||||
public bool isWalkable;
|
||||
public PathNode cameFromNode;
|
||||
|
||||
public List<PathNode> neighbourList = new List<PathNode>();
|
||||
|
||||
public PathNode(Grid<PathNode> _grid, int _x, int _y) {
|
||||
grid = _grid;
|
||||
x = _x;
|
||||
y = _y;
|
||||
isWalkable = false;
|
||||
}
|
||||
|
||||
public void CalculateFCost() {
|
||||
fCost = gCost + hCost;
|
||||
}
|
||||
|
||||
public void SetIsWalkable(bool isWalkable) {
|
||||
this.isWalkable = isWalkable;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return x + "," + y;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user