/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Editor/VisualScripting.State/States/SuperStateWidget.cs
44 строки
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using UnityEditor; using UnityEngine; namespace Unity.VisualScripting { [Widget(typeof(SuperState))] public sealed class SuperStateWidget : NesterStateWidget<SuperState>, IDragAndDropHandler { public SuperStateWidget(StateCanvas canvas, SuperState state) : base(canvas, state) { } #region Drag & Drop 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() { } #endregion } }