Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

SuperStateWidget.cs 1.3KB

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