A game about forced loneliness, made by TACStudios
1namespace Unity.VisualScripting
2{
3 [GraphContextExtension(typeof(FlowGraphContext))]
4 public sealed class FlowGraphContextStateExtension : GraphContextExtension<FlowGraphContext>
5 {
6 public FlowGraphContextStateExtension(FlowGraphContext context) : base(context) { }
7
8 public override bool AcceptsDragAndDrop()
9 {
10 return DragAndDropUtility.Is<StateGraphAsset>();
11 }
12
13 public override void PerformDragAndDrop()
14 {
15 var statemacro = DragAndDropUtility.Get<StateGraphAsset>();
16 var stateUnit = new StateUnit(statemacro);
17 context.canvas.AddUnit(stateUnit, DragAndDropUtility.position);
18 }
19
20 public override void DrawDragAndDropPreview()
21 {
22 GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, DragAndDropUtility.Get<StateGraphAsset>().name, typeof(StateGraphAsset).Icon());
23 }
24 }
25}