Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Allow ports to connect across types

Read time 1 minuteLast updated 21 days ago

To allow connecting ports of different types, for example an
int
port to a
float
port:
  1. Override the method
    Graph.IsConnectionAllowed()
    .
  2. Check the output's data type with
    output.DataType == typeof(int)
    .
  3. Check the input's data type with
    input.DataType == typeof(float)
    .
  4. Return true when conditions match.
Refer to the full example in the IsConnectionAllowed API reference.

Additional resources