Class KeyCodeOption
- Namespace
- ConfigurableWarning.API.Options
- Assembly
- RedstoneWizard08.ContentLibrary.dll
A float option. This must be inherited from to use. Its state is stored in the OptionsState class.
public class KeyCodeOption : KeyCodeSetting, IDisposable, IOption<KeyCode>, ICustomSetting, IExposedSetting, IUntypedOption, IHasStateHolder<KeyCode>
- Inheritance
-
KeyCodeOption
- Implements
-
IOption<KeyCode>IHasStateHolder<KeyCode>
- Inherited Members
Constructors
KeyCodeOption(string, KeyCode, string)
Initialize a IOption<T> with the UnityEngine.KeyCode type.
protected KeyCodeOption(string name, KeyCode defaultValue, string displayName)
Parameters
name
stringThe option's name.
defaultValue
KeyCodeThe default value.
displayName
stringThe option's displayed name.
KeyCodeOption(string, KeyCode, string, Action<KeyCodeOption>[])
Initialize a IOption<T> with the UnityEngine.KeyCode type.
protected KeyCodeOption(string name, KeyCode defaultValue, string displayName, Action<KeyCodeOption>[] actions)
Parameters
name
stringThe option's name.
defaultValue
KeyCodeThe default value.
displayName
stringThe option's displayed name.
actions
Action<KeyCodeOption>[]Functions to run when the value is applied.
Properties
State
Get or set this option's state.
public KeyCode State { get; set; }
Property Value
- KeyCode
StateHolder
Get this object's state holder.
public StateHolder<KeyCode> StateHolder { get; }
Property Value
- StateHolder<KeyCode>
The state holder.
Methods
ApplyValue()
Applies the value. This is run when the user changes the value. This will sync it, update the state, and run any apply actions.
public override void ApplyValue()
AsOption()
Get this as an IOption<T>. This is used for accessing default methods.
public IOption<KeyCode> AsOption()
Returns
- IOption<KeyCode>
This as an IOption<T>.
AsUntyped()
Get this option as an IUntypedOption
public IUntypedOption AsUntyped()
Returns
- IUntypedOption
The IUntypedOption form of this.
GetDefaultKey()
Get this option's default value.
public override KeyCode GetDefaultKey()
Returns
- KeyCode
The option's default value.
GetDefaultValue()
Get this option's default value.
public KeyCode GetDefaultValue()
Returns
- KeyCode
The option's default value.
GetDisplayName()
Get the display name of this option.
public string GetDisplayName()
Returns
- string
The option's display name.
GetName()
Gets this option's name. This is its name in the registry and in the state holder.
public string GetName()
Returns
- string
The option's name.
GetValue()
Gets the current value of the option. WARNING! THIS MAY NOT ALWAYS BE CORRECT! USE THE STATE HOLDER INSTEAD!
public KeyCode GetValue()
Returns
- KeyCode
The (potential) value of this option.
Instance(string)
Get an instance of an option.
public static KeyCodeOption? Instance(string name)
Parameters
name
stringThe option's name.
Returns
- KeyCodeOption
The option.
RegisterSetting(string, string)
Registers this setting with Content Settings. You probably want to use Register(string, string) instead.
public void RegisterSetting(string tab, string category)
Parameters
SetValue(object)
Sets the option's value. This will NOT update it in the state!
public void SetValue(object value)
Parameters
value
objectThe new value.
SetValue(KeyCode)
Sets the option's value. This will NOT update it in the state!
public void SetValue(KeyCode value)
Parameters
value
KeyCodeThe new value.