TryGetPreview(out string)
Retrieves the current string value assigned to the port preview for a given port.
Read time 1 minuteLast updated 8 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor.GraphVisualization
- Assembly: UnityEditor
TryGetPreview(string)
public bool TryGetPreview(out string displayValue)
Parameters
When this method returns true, contains the string value of the port preview; otherwise, .
nullReturns
Type | Description |
|---|---|
| bool | true if the port preview value was successfully retrieved; otherwise, false. |
Remarks
If no port preview is currently set for the given port, this method returns false and is . Call PortReference.SetPreview to assign a display value to a port preview before querying it. Throws ObjectDisposedException when you access this method after you call Context.Dispose on the context.
displayValuenullExamples
if (context.GetPortReference(portID).TryGetPreview(out var displayValue)) Debug.Log(displayValue);