static void OnDrawGizmoNonSelected(WayPointFunction way, GizmoType gizmoType) { var neighbors = way.GetComponent <WayPoint>().neighbors; if (neighbors == null) { return; } Handles.color = Color.yellow; Handles.DrawSolidDisc(way.transform.position, way.transform.forward, 0.1f); foreach (var neighbor in neighbors) { if (neighbor != null && neighbor.gameObject != Selection.activeGameObject) { Handles.color = Color.yellow; Handles.DrawDottedLine(way.transform.position, neighbor.transform.position, 5); Handles.DrawSolidDisc(neighbor.transform.position, neighbor.transform.forward, 0.1f); } } var wayPoint = way.GetComponent <WayPoint>(); if (!wayPoint.isWalkable) { Handles.color = new Color(1, 0, 0, 0.1f); Handles.DrawSolidDisc(way.transform.position, way.transform.forward, 0.6f); } }
static void OnDrawGizmoSelected(WayPointFunction way, GizmoType gizmoType) { var neighbors = way.GetComponent <WayPoint>().neighbors; foreach (var neighbor in neighbors) { if (neighbor != null) { Handles.color = Color.blue; Handles.DrawLine(way.transform.position, neighbor.transform.position); Handles.DrawSolidDisc(neighbor.transform.position, neighbor.transform.forward, 0.2f); } } var wayPoint = way.GetComponent <WayPoint>(); if (wayPoint.isWalkable) { Handles.color = Color.green; Handles.DrawSolidDisc(way.transform.position, way.transform.forward, 0.2f); Handles.color = Color.blue; Handles.DrawSolidDisc(way.transform.position, way.transform.forward, 0.1f); } else { Handles.color = new Color(1, 0, 0, 0.1f); Handles.DrawSolidDisc(way.transform.position, way.transform.forward, 0.6f); } }