Scriptum/Assets/Scripts/Pathfinding/Node.cs

28 lines
552 B
C#
Raw Permalink Normal View History

2022-11-07 22:18:28 +01:00
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;
}
}