Description
The Vector2
field is a member of the NodeResultType
enumeration within the Editor.ShaderGraph
namespace. This enumeration is used to specify the type of result that a node in a shader graph can produce. The Vector2
type indicates that the node's output is a two-dimensional vector, which is commonly used in graphics programming for representing points, directions, or other two-component data.
Usage
Use the NodeResultType.Vector2
when you need to define or check the output type of a shader graph node that produces a two-dimensional vector. This is particularly useful when working with shader nodes that require or output 2D vector data, such as texture coordinates or 2D transformations.
Example
// Example of using NodeResultType.Vector2 in a shader graph context
// Assume we are defining a custom shader node
public class CustomShaderNode : ShaderNode
{
public override NodeResultType GetNodeResultType()
{
// This node outputs a Vector2 type
return NodeResultType.Vector2;
}
}