A game about forced loneliness, made by TACStudios
at master 66 lines 2.0 kB view raw
1using UnityEngine; 2 3namespace UnityEditor.U2D.Animation 4{ 5 internal enum SpriteMeshViewMode 6 { 7 EditGeometry, 8 CreateVertex, 9 CreateEdge, 10 SplitEdge 11 } 12 13 internal enum MeshEditorAction 14 { 15 None, 16 CreateVertex, 17 MoveVertex, 18 CreateEdge, 19 SplitEdge, 20 MoveEdge, 21 SelectVertex, 22 SelectEdge, 23 Remove 24 } 25 26 internal interface ISpriteMeshView 27 { 28 SpriteMeshViewMode mode { get; set; } 29 ISelection<int> selection { get; set; } 30 int defaultControlID { get; set; } 31 Rect frame { get; set; } 32 Vector2 mouseWorldPosition { get; } 33 int hoveredVertex { get; } 34 int hoveredEdge { get; } 35 int closestEdge { get; } 36 37 void CancelMode(); 38 void BeginLayout(); 39 void EndLayout(); 40 void LayoutVertex(Vector2 position, int index); 41 void LayoutEdge(Vector2 startPosition, Vector2 endPosition, int index); 42 bool DoCreateVertex(); 43 bool DoSelectVertex(out bool additive); 44 bool DoMoveVertex(out Vector2 delta); 45 bool DoMoveEdge(out Vector2 delta); 46 bool DoCreateEdge(); 47 bool DoSplitEdge(); 48 bool DoSelectEdge(out bool additive); 49 bool DoRemove(); 50 void DrawVertex(Vector2 position); 51 void DrawVertexHovered(Vector2 position); 52 void DrawVertexSelected(Vector2 position); 53 void BeginDrawEdges(); 54 void EndDrawEdges(); 55 void DrawEdge(Vector2 startPosition, Vector2 endPosition); 56 void DrawEdgeHovered(Vector2 startPosition, Vector2 endPosition); 57 void DrawEdgeSelected(Vector2 startPosition, Vector2 endPosition); 58 bool IsActionTriggered(MeshEditorAction action); 59 bool IsActionActive(MeshEditorAction action); 60 bool IsActionHot(MeshEditorAction action); 61 Vector2 WorldToScreen(Vector2 position); 62 void DoRepaint(); 63 bool CanRepaint(); 64 bool CanLayout(); 65 } 66}