Maze / Library /PackageCache /com.unity.visualscripting@1.8.0 /Editor /VisualScripting.State /States /SuperStateWidget.cs
| using UnityEditor; | |
| using UnityEngine; | |
| namespace Unity.VisualScripting | |
| { | |
| [] | |
| public sealed class SuperStateWidget : NesterStateWidget<SuperState>, IDragAndDropHandler | |
| { | |
| public SuperStateWidget(StateCanvas canvas, SuperState state) : base(canvas, state) { } | |
| public DragAndDropVisualMode dragAndDropVisualMode => DragAndDropVisualMode.Generic; | |
| public bool AcceptsDragAndDrop() | |
| { | |
| return DragAndDropUtility.Is<StateGraphAsset>(); | |
| } | |
| public void PerformDragAndDrop() | |
| { | |
| UndoUtility.RecordEditedObject("Drag & Drop Macro"); | |
| state.nest.source = GraphSource.Macro; | |
| state.nest.macro = DragAndDropUtility.Get<StateGraphAsset>(); | |
| state.nest.embed = null; | |
| GUI.changed = true; | |
| } | |
| public void UpdateDragAndDrop() | |
| { | |
| } | |
| public void DrawDragAndDropPreview() | |
| { | |
| GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(edgePosition.x, outerPosition.yMax), "Replace with: " + DragAndDropUtility.Get<StateGraphAsset>().name, typeof(StateGraphAsset).Icon()); | |
| } | |
| public void ExitDragAndDrop() | |
| { | |
| } | |
| } | |
| } | |