Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

IPort.TrySetDataType

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public bool TrySetDataType(Type type);

Parameters

Parameter Description
type The type to assign to the port. Must be one of the types the port was declared to support (see IInputPortBuilder.WithDataTypes / IOutputPortBuilder.WithDataTypes).

Returns

bool true if the type was applied; false if the port is not polymorphic or if type is not one of the port's supported types.

Description

Changes the current IPort.DataType of a polymorphic port.

Use this method to programmatically drive the type selection of a polymorphic port (the same selection the user changes through the port's dropdown in the UI). This method has no effect on non-polymorphic ports.