Scriptum/Assets/Scripts/Pathfinding/Node.cs
2022-12-04 20:48:40 +01:00

28 lines
552 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class Node
{
public int GCost;
public int hCost;
public Node parent;
public bool walkable = false;
public int FCost
{
get
{
return GCost + hCost;
}
}
public Vector3 worldPosition;
public Vector2Int gridPosition;
public Node(Vector2Int _gridPosition, Vector3 _worldPosition)
{
worldPosition = _worldPosition;
gridPosition = _gridPosition;
}
}