Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

PortReference.SetPreview

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 void SetPreview(string displayValue);

Parameters

Parameter Description
displayValue String to display in the port preview.

Description

Sets the string value to display in a port preview for a given port.

The string is displayed with default styling in the port preview next to the port in the graph. Setting a new value overwrites any existing value for that port preview. Setting a null value clears the port preview for the given port, hiding it from the graph canvas until a new value is set for that port. This is equivalent to calling PortReference.ClearPreview for the given port. If a graph canvas is attached to the PortReference.Context and the port ID does not correspond to any port in the graph, any stored preview data for that port is removed and the call has no further effect. If no graph canvas is attached yet, the value is stored and applied when a graph canvas becomes available. Throws ObjectDisposedException when you access this method after you call Context.Dispose on the context.

 context.GetPortReference(portID).SetPreview("42.0");