In this tutorial, we create an IsPlaceable property in the Waypoint script. And to access this property in the Coordinate Labeler script we use the following syntax:
Waypoint waypoint;
void Awake()
{
waypoint = GetComponentInParent();
}
However some textbooks mention creating an instance of a class in order to access that class members with the following syntax:
Waypoint waypoint = new Waypoint();
Are these equivalent ways of achieving the same result? Thank you.