StartNode.cs 666 B

123456789101112131415161718192021222324
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Reflection;
  4. using GraphProcessor;
  5. namespace NodeGraphProcessor.Examples
  6. {
  7. [System.Serializable, NodeMenuItem("Conditional/Start")]
  8. public class StartNode : BaseNode, IConditionalNode
  9. {
  10. [Output(name = "Executes")]
  11. public ConditionalLink executes;
  12. public override string name => "Start";
  13. public IEnumerable< ConditionalNode > GetExecutedNodes()
  14. {
  15. // Return all the nodes connected to the executes port
  16. return GetOutputNodes().Where(n => n is ConditionalNode).Select(n => n as ConditionalNode);
  17. }
  18. public override FieldInfo[] GetNodeFields() => base.GetNodeFields();
  19. }
  20. }