Namespace: | Sirenix.OdinInspector.Editor |
Assembly: | Sirenix.OdinInspector.Editor |
public static class OdinObjectSelector
public static bool IsOpen { get; }
public static int SelectorId { get; }
public static object SelectorKey { get; }
public static object SelectorObject { get; }
public static object Claim()
System.Object | The SelectorObject if it is ready to be claimed; otherwise, NULL with an accompanying error message. |
amount
) of instances of the SelectorObject.
public static object[] ClaimMultiple(int amount)
System.Int32 | amount | The number of instances to copy. |
System.Object[] | An array of SelectorObject copies, where element 0 is always the original value, if the SelectorObject is ready to be claimed; otherwise, NULL with an accompanying error message. |
public static T GetChangedObject<T>(T value, object key, int id)
T | value | The current value; the value to return if no change has occurred. |
System.Object | key | The key to identify who showed the current selector. |
System.Int32 | id | The ID to identify who showed the current selector. |
T | SelectorObject if it was marked as changed, otherwise |
T | The type of object to expect as a return value. |
key
and id
combination match the currently open selectors.
public static bool IsCurrentSelector(object key, int id)
System.Object | key | The key to match. |
System.Int32 | id | The ID to match. |
System.Boolean |
|
public static bool IsReadyToClaim(object key, int id)
System.Object | key | The key to identify who showed the current selector. |
System.Int32 | id | The ID to identify who showed the current selector. |
System.Boolean |
|
public static void Show(object key, int id, object value, Type baseType, bool allowSceneObjects = true, bool disallowNullValues = false, Rect position = null)
System.Object | key | The key used to identify who called the selector; this can be null. |
System.Int32 | id | The ID used to identify who called the selector; this can be 0. |
System.Object | value | The current value selected. |
System.Type | baseType | The base type of the 'value'. |
System.Boolean | allowSceneObjects | Determines if scene objects are allowed. |
System.Boolean | disallowNullValues | Determines if null values are allowed. |
UnityEngine.Rect | position | The position where the selector should appear. |
System.NotImplementedException | Thrown if the selector was opened for a case that it didn't expect. |