Namespace: | Sirenix.OdinInspector.Editor.ActionResolvers |
Assembly: | Sirenix.OdinInspector.Editor |
public sealed class ActionResolver
An ActionResolver resolves a string to an action, given an InspectorProperty instance to use as context. Call Get(InspectorProperty, String) to get an instance of an ActionResolver.
Action resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering an ActionResolverCreator.
See Odin's tutorials for details and examples of how to use ActionResolvers.
public ActionResolver()
public ResolvedAction Action
public ActionResolverContext Context
public string ErrorMessage { get; }
public bool HasError { get; }
public void DoAction(int selectionIndex = 0)
System.Int32 | selectionIndex | The selection index to execute the action on. Defaults to 0. |
public void DoActionForAllSelectionIndices()
public void DrawError()
public static void DrawErrors(ActionResolver r1 = null, ActionResolver r2 = null, ActionResolver r3 = null, ActionResolver r4 = null, ActionResolver r5 = null, ActionResolver r6 = null, ActionResolver r7 = null, ActionResolver r8 = null)
ActionResolver | r1 | |
ActionResolver | r2 | |
ActionResolver | r3 | |
ActionResolver | r4 | |
ActionResolver | r5 | |
ActionResolver | r6 | |
ActionResolver | r7 | |
ActionResolver | r8 |
public static void DrawErrors(ActionResolver r1 = null, ActionResolver r2 = null, ActionResolver r3 = null, ActionResolver r4 = null, ActionResolver r5 = null, ActionResolver r6 = null, ActionResolver r7 = null, ActionResolver r8 = null, params ActionResolver[] remainder)
ActionResolver | r1 | |
ActionResolver | r2 | |
ActionResolver | r3 | |
ActionResolver | r4 | |
ActionResolver | r5 | |
ActionResolver | r6 | |
ActionResolver | r7 | |
ActionResolver | r8 | |
ActionResolver[] | remainder |
public static ActionResolver Get(InspectorProperty property, string resolvedString)
InspectorProperty | property | The property that is the context for the resolution to happen in. |
System.String | resolvedString | The string that should be resolved to an action. |
ActionResolver |
public static ActionResolver Get(InspectorProperty property, string resolvedString, params NamedValue[] namedArgs)
InspectorProperty | property | The property that is the context for the resolution to happen in. |
System.String | resolvedString | The string that should be resolved to an action. |
NamedValue[] | namedArgs | The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. |
ActionResolver |
public static string GetCombinedErrors(ActionResolver r1 = null, ActionResolver r2 = null, ActionResolver r3 = null, ActionResolver r4 = null, ActionResolver r5 = null, ActionResolver r6 = null, ActionResolver r7 = null, ActionResolver r8 = null)
ActionResolver | r1 | |
ActionResolver | r2 | |
ActionResolver | r3 | |
ActionResolver | r4 | |
ActionResolver | r5 | |
ActionResolver | r6 | |
ActionResolver | r7 | |
ActionResolver | r8 |
System.String |
public static string GetCombinedErrors(ActionResolver r1, ActionResolver r2, ActionResolver r3, ActionResolver r4, ActionResolver r5, ActionResolver r6, ActionResolver r7, ActionResolver r8, params ActionResolver[] remainder)
ActionResolver | r1 | |
ActionResolver | r2 | |
ActionResolver | r3 | |
ActionResolver | r4 | |
ActionResolver | r5 | |
ActionResolver | r6 | |
ActionResolver | r7 | |
ActionResolver | r8 | |
ActionResolver[] | remainder |
System.String |
public static ActionResolver GetFromContext(ref ActionResolverContext context)
ActionResolverContext | context | The pre-built context that should be used to get a resolver. |
ActionResolver |