Version: 2022.3
LanguageEnglish
  • C#

PropertyContainer.TryGetProperty

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 static bool TryGetProperty(TContainer container, ref Unity.Properties.PropertyPath path, out Unity.Properties.IProperty property);

Parameters

container The container tree to search.
path 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

bool <see langword="true" /> if the property was found at the specified path; otherwise, <see langword="false" />.

Description

Gets an IProperty on the specified container for the given PropertyPath.

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


Declaration

public static bool TryGetProperty(ref TContainer container, ref Unity.Properties.PropertyPath path, out Unity.Properties.IProperty property, out Unity.Properties.VisitReturnCode returnCode);

Parameters

container The container tree to search.
path 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

bool <see langword="true" /> if the property was found at the specified path; otherwise, <see langword="false" />.

Description

Gets an IProperty on the specified container for the given PropertyPath.

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