Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AddInput<U, V>(U, V, int, float)

Create a new input port and connect it to the output port of the given Playable.
Read time 1 minuteLast updated 6 days ago

Definition

AddInput<T, U>(T, T, int, float)

public static int AddInput<U, V>(this U playable, V sourcePlayable, int sourceOutputIndex, float weight = 0) where U : struct, IPlayable where V : struct, IPlayable

Parameters

playable

T
The Playable used by this operation.

sourcePlayable

T
The Playable to connect to.

sourceOutputIndex

The output port of the Playable.

weight

The weight of the created input port.

Returns

Type

Description

intThe index of the newly created input port.

Remarks

If several inputs are needed, it is better to use PlayableExtensions.SetInputCount and PlayableExtensions.ConnectInput.
This method is a mere helper on top of PlayableGraph.Connect.
Use this templated extension method on any type that inherits from IPlayable.