28 lines
552 B
C#
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;
|
|
}
|
|
}
|