Version 2.1.0.0

PersistentContext class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public static class PersistentContext
Provides context objects that still persist when Unity reloads or is restartet.
Inheritance
  • System.Object
  • PersistentContext

Methods

Get<TKey1, TValue>(TKey1, TValue)
Gets a GlobalPersistentContext object for the specified key.
public static GlobalPersistentContext<TValue> Get<TKey1, TValue>(TKey1 alphaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
GlobalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TValue

The type of the value stored in the context object.

Get<TKey1, TValue>(TKey1, out GlobalPersistentContext<TValue>)
Gets a GlobalPersistentContext object for the specified key. Returns true when the context is first created. Otherwise false.
public static bool Get<TKey1, TValue>(TKey1 alphaKey, out GlobalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

GlobalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TValue>(TKey1, TKey2, TValue)
Gets a GlobalPersistentContext object for the specified keys.
public static GlobalPersistentContext<TValue> Get<TKey1, TKey2, TValue>(TKey1 alphaKey, TKey2 betaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
GlobalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TValue>(TKey1, TKey2, out GlobalPersistentContext<TValue>)
Gets a GlobalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool Get<TKey1, TKey2, TValue>(TKey1 alphaKey, TKey2 betaKey, out GlobalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

GlobalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TKey3, TValue>(TKey1, TKey2, TKey3, TValue)
Gets a GlobalPersistentContext object for the specified keys.
public static GlobalPersistentContext<TValue> Get<TKey1, TKey2, TKey3, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
GlobalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TKey3, TValue>(TKey1, TKey2, TKey3, out GlobalPersistentContext<TValue>)
Gets a GlobalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool Get<TKey1, TKey2, TKey3, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, out GlobalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

GlobalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1, TKey2, TKey3, TKey4, TValue)
Gets a GlobalPersistentContext object for the specified keys.
public static GlobalPersistentContext<TValue> Get<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
GlobalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1, TKey2, TKey3, TKey4, out GlobalPersistentContext<TValue>)
Gets a GlobalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool Get<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, out GlobalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

GlobalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1, TKey2, TKey3, TKey4, TKey5, TValue)
Gets a GlobalPersistentContext object for the specified keys.
public static GlobalPersistentContext<TValue> Get<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, TKey5 epsilonKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

TKey5 epsilonKey

The fifth key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
GlobalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TKey5

The type of the fifth key.

TValue

The type of the value stored in the context object.

Get<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1, TKey2, TKey3, TKey4, TKey5, out GlobalPersistentContext<TValue>)
Gets a GlobalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool Get<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, TKey5 epsilonKey, out GlobalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

TKey5 epsilonKey

The fifth key.

GlobalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TKey5

The type of the fifth key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TValue>(TKey1, TValue)
Gets a LocalPersistentContext object for the specified key.
public static LocalPersistentContext<TValue> GetLocal<TKey1, TValue>(TKey1 alphaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
LocalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TValue>(TKey1, out LocalPersistentContext<TValue>)
Gets a LocalPersistentContext object for the specified key. Returns true when the context is first created. Otherwise false.
public static bool GetLocal<TKey1, TValue>(TKey1 alphaKey, out LocalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

LocalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TValue>(TKey1, TKey2, TValue)
Gets a LocalPersistentContext object for the specified keys.
public static LocalPersistentContext<TValue> GetLocal<TKey1, TKey2, TValue>(TKey1 alphaKey, TKey2 betaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
LocalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TValue>(TKey1, TKey2, out LocalPersistentContext<TValue>)
Gets a LocalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool GetLocal<TKey1, TKey2, TValue>(TKey1 alphaKey, TKey2 betaKey, out LocalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

LocalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TKey3, TValue>(TKey1, TKey2, TKey3, TValue)
Gets a LocalPersistentContext object for the specified keys.
public static LocalPersistentContext<TValue> GetLocal<TKey1, TKey2, TKey3, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
LocalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TKey3, TValue>(TKey1, TKey2, TKey3, out LocalPersistentContext<TValue>)
Gets a LocalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool GetLocal<TKey1, TKey2, TKey3, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, out LocalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

LocalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1, TKey2, TKey3, TKey4, TValue)
Gets a LocalPersistentContext object for the specified keys.
public static LocalPersistentContext<TValue> GetLocal<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
LocalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1, TKey2, TKey3, TKey4, out LocalPersistentContext<TValue>)
Gets a LocalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool GetLocal<TKey1, TKey2, TKey3, TKey4, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, out LocalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

LocalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1, TKey2, TKey3, TKey4, TKey5, TValue)
Gets a LocalPersistentContext object for the specified keys.
public static LocalPersistentContext<TValue> GetLocal<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, TKey5 epsilonKey, TValue defaultValue)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

TKey5 epsilonKey

The fifth key.

TValue defaultValue

The default value, used for when the context object is first created.

Returns
LocalPersistentContext<TValue>

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TKey5

The type of the fifth key.

TValue

The type of the value stored in the context object.

GetLocal<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1, TKey2, TKey3, TKey4, TKey5, out LocalPersistentContext<TValue>)
Gets a LocalPersistentContext object for the specified keys. Returns true when the context is first created. Otherwise false.
public static bool GetLocal<TKey1, TKey2, TKey3, TKey4, TKey5, TValue>(TKey1 alphaKey, TKey2 betaKey, TKey3 gammaKey, TKey4 deltaKey, TKey5 epsilonKey, out LocalPersistentContext<TValue> context)
Parameters
TKey1 alphaKey

The first key.

TKey2 betaKey

The second key.

TKey3 gammaKey

The third key.

TKey4 deltaKey

The fourth key.

TKey5 epsilonKey

The fifth key.

LocalPersistentContext<TValue> context

The persistent context object.

Returns
System.Boolean

Returns true when the context is first created. Otherwise false.

Type Parameters
TKey1

The type of the first key.

TKey2

The type of the second key.

TKey3

The type of the third key.

TKey4

The type of the fourth key.

TKey5

The type of the fifth key.

TValue

The type of the value stored in the context object.