mirror of
https://github.com/Xevion/Boids.git
synced 2026-01-31 02:23:36 -06:00
transform sceneview to focus on specific boid when one is focused, allow size change, use orthographic rot
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user