Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetProperty

Gets an IProperty on the specified container for the given PropertyPath.
Read time 2 minutesLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: Unity.Properties
  • Assembly: UnityEngine.PropertiesModule

TryGetProperty<T>(T, PropertyPath, IProperty)

Gets an IProperty on the specified container for the given PropertyPath.
public static bool TryGetProperty<TContainer>(TContainer container, in PropertyPath path, out IProperty property)

Parameters

container

T
The container tree to search.

The property path to resolve.

property

When this method returns, contains the property associated with the specified path, if the property is found; otherwise, null.

Returns

Type

Description

bool
true
if the property was found at the specified path; otherwise,
false
.

Remarks

While the container data is not actually read from or written to. The container itself is needed to resolve polymorphic fields and list elements.

TryGetProperty<T>(T, PropertyPath, IProperty)

Gets an IProperty on the specified container for the given PropertyPath.
public static bool TryGetProperty<TContainer>(ref TContainer container, in PropertyPath path, out IProperty property)

Parameters

container

T
The container tree to search.

The property path to resolve.

property

When this method returns, contains the property associated with the specified path, if the property is found; otherwise, null.

Returns

Type

Description

bool
true
if the property was found at the specified path; otherwise,
false
.

Remarks

While the container data is not actually read from or written to. The container itself is needed to resolve polymorphic fields and list elements.

TryGetProperty<T>(T, PropertyPath, IProperty, VisitReturnCode)

Gets an IProperty on the specified container for the given PropertyPath.
public static bool TryGetProperty<TContainer>(ref TContainer container, in PropertyPath path, out IProperty property, out VisitReturnCode returnCode)

Parameters

container

T
The container tree to search.

The property path to resolve.

property

When this method returns, contains the property associated with the specified path, if the property is found; otherwise, null.

returnCode

When this method returns, contains the return code.

Returns

Type

Description

bool
true
if the property was found at the specified path; otherwise,
false
.

Remarks

While the container data is not actually read from or written to. The container itself is needed to resolve polymorphic fields and list elements.