RectVertexSelector.cs 581 B

123456789101112131415161718192021
  1. using UnityEngine;
  2. using System.Collections.Generic;
  3. namespace UnityEditor.U2D.Animation
  4. {
  5. internal class RectVertexSelector : IRectSelector<int>
  6. {
  7. public ISelection<int> selection { get; set; }
  8. public ISpriteMeshData spriteMeshData { get; set; }
  9. public Rect rect { get; set; }
  10. public void Select()
  11. {
  12. for (int i = 0; i < spriteMeshData.vertexCount; i++)
  13. {
  14. if (rect.Contains(spriteMeshData.GetPosition(i), true))
  15. selection.Select(i, true);
  16. }
  17. }
  18. }
  19. }