29 lines
585 B
C#
29 lines
585 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.Build.Content;
|
|
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;
|
|
}
|
|
}
|