Class Node<TInput, TOutput>
Base class used to implement an import step in an Importer
Inherited Members
Namespace: UnityEngine .Importer
Assembly: Unity.Importer.dll
Syntax
public abstract class Node<TInput, TOutput> : INode<TInput, TOutput>, INodeSerialization where TInput : InputPorts where TOutput : OutputPorts
Type Parameters
Name | Description |
---|---|
TInput | The type containing all inputs for this import step. |
TOutput | The type containing all outputs for this import step. |
Remarks
Inherit from it to implement your own import process step and add them to a graph to drive your import. For example, this node is getting a GameObject as an input, adds a Camera component to it and output the modified GameObject. INSERT-DOCUMENTATION-LINK
Examples
using UnityEngine;
[NodeMetadata("CameraNode", 0)]
public class AddCameraNode : Node<AddCameraNode.MyInputPort, AddCameraNode.MyOutputPort>
{
public class MyInputPort : InputPorts
{
public GameObject root;
}
public class MyOutputPort : OutputPorts
{
public GameObject root;
}
public override void Run()
{
GameObject root = Input.root;
root.AddComponent<Camera>();
Output.root = root;
}
}
Properties
Input
The instance of the class containing all the Inputs required to process the node.
Declaration
public TInput Input { get; set; }
Property Value
Type | Description |
---|---|
TInput |
Remarks
The content of this class will be populated by the graph execution and should be used in the Run() method to generate the Output content.
Output
The instance of the class containing all the Outputs that the node is creating.
Declaration
public TOutput Output { get; set; }
Property Value
Type | Description |
---|---|
TOutput |
Remarks
The content of this class need to be populated during the Run() method based on the content received in the Input.
Methods
Run()
This method has to be implemented for each Node<TInput, TOutput>.
Declaration
public abstract void Run()
Remarks
During the Importer