IfNodeView.cs 585 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using UnityEditor.UIElements;
  6. using UnityEditor.Experimental.GraphView;
  7. using UnityEngine.UIElements;
  8. using GraphProcessor;
  9. [NodeCustomEditor(typeof(IfNode))]
  10. public class IfNodeView : BaseNodeView
  11. {
  12. public override void Enable()
  13. {
  14. hasSettings = true; // or base.Enable();
  15. var node = nodeTarget as IfNode;
  16. // Create your fields using node's variables and add them to the controlsContainer
  17. controlsContainer.Add(new Label($"Last Evaluation: {node.condition}"));
  18. }
  19. }