As a first step, we will implement the preliminary classes that we introduced before, such as the Node class, the GridManager class, and the PriorityQueue class. Then, we will use them in the main AStar class.
Implementing the A* algorithm
Node
The Node class will handle each tile object in our 2D grid and will be, used to represent the maps shown in the Node.cs file:
using UnityEngine; using System.Collections; using System; public class Node : IComparable { public float nodeTotalCost; public float estimatedCost; public bool bObstacle; public Node parent; public Vector3 position; public Node() { this.estimatedCost = 0.0f; this.nodeTotalCost = 1.0f; this.bObstacle = false; this...