No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GridSelectionMoveTool.cs 1.2KB

1234567891011121314151617181920212223242526272829303132
  1. using UnityEditor.EditorTools;
  2. using UnityEngine;
  3. namespace UnityEditor.Tilemaps
  4. {
  5. /// <summary>
  6. /// An `EditorTool` for handling Moves for a `GridSelection`.
  7. /// </summary>
  8. public class GridSelectionMoveTool : GridSelectionTool
  9. {
  10. private static class Styles
  11. {
  12. public static GUIContent toolbarIcon = EditorGUIUtility.TrTextContentWithIcon("Move", "Shows a Gizmo in the Scene view for changing the offset for the Grid Selection", "MoveTool");
  13. }
  14. /// <summary>
  15. /// Toolbar icon for the `GridSelectionMoveTool`.
  16. /// </summary>
  17. public override GUIContent toolbarIcon => Styles.toolbarIcon;
  18. /// <summary>
  19. /// Handles the gizmo for managing Moves for the `GridSelectionMoveTool`.
  20. /// </summary>
  21. /// <param name="position">Position of the `GridSelection` gizmo.</param>
  22. /// <param name="rotation">Rotation of the `GridSelection` gizmo.</param>
  23. /// <param name="scale">Scale of the `GridSelection` gizmo.</param>
  24. public override void HandleTool(ref Vector3 position, ref Quaternion rotation, ref Vector3 scale)
  25. {
  26. position = Handles.PositionHandle(position, rotation);
  27. }
  28. }
  29. }