This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example output ports and how we can use them: | |
[Output(dynamicPortList = true)] | |
public string[] stringOutputs; | |
[Output(dynamicPortList = true)] | |
public float[] floatOutputs; | |
public override object GetValue(NodePort port) { | |
// Boilerplate reduction: instead of parsing ports manually every single time, just "expose" a function for the index, if it matches | |
// You can even chain them with null coalescing in order to not check subsequent fields after one is found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Diagnostics.CodeAnalysis; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using UnityEngine; | |
using UnityEditor; |