Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetApplyMethodForFieldName(SerializedProperty, out Action<SerializedProperty>)

Extension hook for an optional property apply menu item.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

TryGetApplyMethodForFieldName(SerializedProperty, Action<SerializedProperty>)

bool TryGetApplyMethodForFieldName(SerializedProperty property, out Action<SerializedProperty> applyMethod)

Parameters

The property that the user is interacting with.

Assign the custom action to be called if the user selects the apply menu command.

Returns

Type

Description

boolTrue, if the apply menu should be shown for the property.

Remarks

Called as the context menu is being built to retrieve the method to be called (if any) when the user selects the 'apply' menu item. The boolean return value defines if an apply menu item is to be shown.