A game about forced loneliness, made by TACStudios
1using UnityEditor;
2using UnityEngine;
3
4namespace Unity.VisualScripting
5{
6 [Widget(typeof(SuperState))]
7 public sealed class SuperStateWidget : NesterStateWidget<SuperState>, IDragAndDropHandler
8 {
9 public SuperStateWidget(StateCanvas canvas, SuperState state) : base(canvas, state) { }
10
11 #region Drag & Drop
12
13 public DragAndDropVisualMode dragAndDropVisualMode => DragAndDropVisualMode.Generic;
14
15 public bool AcceptsDragAndDrop()
16 {
17 return DragAndDropUtility.Is<StateGraphAsset>();
18 }
19
20 public void PerformDragAndDrop()
21 {
22 UndoUtility.RecordEditedObject("Drag & Drop Macro");
23 state.nest.source = GraphSource.Macro;
24 state.nest.macro = DragAndDropUtility.Get<StateGraphAsset>();
25 state.nest.embed = null;
26 GUI.changed = true;
27 }
28
29 public void UpdateDragAndDrop()
30 {
31 }
32
33 public void DrawDragAndDropPreview()
34 {
35 GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(edgePosition.x, outerPosition.yMax), "Replace with: " + DragAndDropUtility.Get<StateGraphAsset>().name, typeof(StateGraphAsset).Icon());
36 }
37
38 public void ExitDragAndDrop()
39 {
40 }
41
42 #endregion
43 }
44}