transform sceneview to focus on specific boid when one is focused, allow size change, use orthographic rot

This commit is contained in:
Xevion
2020-06-04 23:06:28 -05:00
parent e6ec6a3942
commit 8ee9f33082
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -12,6 +12,7 @@ public class BoidGizmoDrawer {
[DrawGizmo(GizmoType.NonSelected | GizmoType.Selected)]
static void DrawGizmo(Boid boid, GizmoType gizmoType) {
// Simply draw the # of Boids within the perceived flock
Handles.Label(boid.transform.position, $"{boid.latestNeighborhoodCount}");
}
}
+6
View File
@@ -78,6 +78,12 @@ public class BoidController : MonoBehaviour {
focusedBoid = boids[Random.Range(0, boids.Count)];
focusedBoid.EnableFocusing();
}
// Focus on the boid in scene view when one is focused
#if UNITY_EDITOR
if(focusedBoid != null)
SceneView.lastActiveSceneView.LookAt(focusedBoid.transform.position, Quaternion.identity);
#endif
}
private void Start() {