//properly destroy current pedestrian public void DestroyPedestrian(PedestrianSystemManager pedestrianSystem) { if (!isDestroyed) { isDestroyed = true; pedestrianSystem.curPedestiansSpawned--; Destroy(this.gameObject); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); PedestrianSystemManager myScript = (PedestrianSystemManager)target; if (GUILayout.Button("Get Waypoints")) { myScript.GetWaypoints(); } if (GUILayout.Button("Add Waypoint")) { myScript.AddWaypoint(); } if (GUILayout.Button("Remove Waypoint")) { myScript.RemoveLastWaypoint(); } }