/// <inheritdoc /> public override void Pick() { // Ensure player is not moving objects if (ActiveAxis != Axis.None) { return; } // Get mouse ray and try to hit foliage instance var foliage = GizmoMode.SelectedFoliage; if (!foliage) { return; } var ray = Owner.MouseRay; FoliageTools.Intersects(foliage, ray, out _, out _, out var instanceIndex); // Change the selection (with undo) if (GizmoMode.SelectedInstanceIndex == instanceIndex) { return; } var action = new EditSelectedInstanceIndexAction(GizmoMode.SelectedInstanceIndex, instanceIndex); action.Do(); Owner.Undo?.AddAction(action); }
/// <inheritdoc /> public override void Pick() { // Get mouse ray and try to hit foliage instance var foliage = Mode.SelectedFoliage; if (!foliage) { return; } var ray = Owner.MouseRay; FoliageTools.Intersects(foliage, ray, out _, out _, out var instanceIndex); Mode.SelectedInstanceIndex = instanceIndex; }
/// <inheritdoc /> public override void Pick() { // Ensure player is not moving objects if (ActiveAxis != Axis.None) { return; } // Get mouse ray and try to hit foliage instance var foliage = GizmoMode.SelectedFoliage; if (!foliage) { return; } var ray = Owner.MouseRay; FoliageTools.Intersects(foliage, ray, out _, out _, out var instanceIndex); GizmoMode.SelectedInstanceIndex = instanceIndex; }