August 2018
Beginner
334 pages
10h 19m
English
We will create the Waypoint class and add the methods for condensing the set of waypoints:
using UnityEngine;using System.Collections;using System.Collections.Generic;public class Waypoint : MonoBehaviour, IComparer{ public float value; public List<Waypoint> neighbours;}
public int Compare(object a, object b){ Waypoint wa = (Waypoint)a; Waypoint wb = (Waypoint)b; if (wa.value == wb.value) return 0; if (wa.value < wb.value) return -1; return 1;}
public static bool CanMove(Waypoint ...
Read now
Unlock full access