DisplayValue.cs 854 B

1234567891011121314151617181920
  1. namespace XNode.Examples.MathNodes {
  2. public class DisplayValue : XNode.Node {
  3. /// <summary>
  4. /// Create an input port that only allows a single connection.
  5. /// The backing value is not important, as we are only interested in the input value.
  6. /// We are also acceptable of all input types, so any type will do, as long as it is serializable.
  7. /// </summary>
  8. [Input(ShowBackingValue.Never, ConnectionType.Override)] public Anything input;
  9. /// <summary> Get the value currently plugged in to this node </summary>
  10. public object GetValue() {
  11. return GetInputValue<object>("input");
  12. }
  13. /// <summary> This class is defined for the sole purpose of being serializable </summary>
  14. [System.Serializable] public class Anything {}
  15. }
  16. }