Version 3.3.1.2

ValueResolver<TResult> class

Namespace: Sirenix.OdinInspector.Editor.ValueResolvers
Assembly: Sirenix.OdinInspector.Editor
public sealed class ValueResolver<TResult> : ValueResolver

A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call Get<TResult>(InspectorProperty, String) to get an instance of a ValueResolver.

Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a ValueResolverCreator.

See Odin's tutorials for details and examples of how to use ValueResolvers.

Inheritance

Type Parameters

TResult

Constructors

ValueResolver()
public ValueResolver()

Fields

Func
The delegate that does the actual value resolution. You should not call this manually, but instead call GetValue(Int32).
public ValueResolverFunc<TResult> Func

Properties

ValueType
The type of value that this resolver instance is supposed to get. Always equal to typeof().
public override Type ValueType { get; }

Methods

GetValue(Int32)
Gets a value from the value resolver.
public TResult GetValue(int selectionIndex = 0)
Parameters
System.Int32 selectionIndex

The selection index at which to get the value, in the case of multi-selection. Defaults to 0.

Returns
TResult

The value that was gotten.

GetWeakValue(Int32)
Gets a value from the value resolver in a weakly typed manner.
public override object GetWeakValue(int selectionIndex = 0)
Parameters
System.Int32 selectionIndex

The selection index at which to get the value, in the case of multi-selection. Defaults to 0.

Returns
System.Object

The value that was gotten.