GenericVertexSelector.cs 632 B

12345678910111213141516171819202122
  1. using System;
  2. using UnityEngine;
  3. namespace UnityEditor.U2D.Animation
  4. {
  5. internal class GenericVertexSelector : ISelector<int>
  6. {
  7. public ISelection<int> selection { get; set; }
  8. public ISpriteMeshData spriteMeshData { get; set; }
  9. public Func<int, bool> SelectionCallback;
  10. public void Select()
  11. {
  12. Debug.Assert(selection != null);
  13. Debug.Assert(spriteMeshData != null);
  14. Debug.Assert(SelectionCallback != null);
  15. for (var i = 0; i < spriteMeshData.vertexCount; i++)
  16. selection.Select(i, SelectionCallback(i));
  17. }
  18. }
  19. }