BoolPref Class

Summary

[Editor-Only] A simple wrapper around UnityEditor.EditorPrefs to get and set a bool.

If you are interested in a more comprehensive pref wrapper that supports more types, you should check out Inspector Gadgets.
Assembly
Animancer.dll
Namespace
Animancer.Editor
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["BoolPref"] class Type type-node

Syntax

public sealed class BoolPref

Constructors

Name Summary
BoolPref(string, bool) Constructs a new Animancer.Editor.BoolPref.
BoolPref(string, string, bool) Constructs a new Animancer.Editor.BoolPref.

Fields

Name Constant Value Summary
DefaultValue
The starting value to use for this pref if none was previously saved.
Key
The identifier with which this pref will be saved.
KeyPrefix Animancer/
The prefix which is automatically added before the Animancer.Editor.BoolPref.Key.
static
MenuItem
The label to use when adding a function to toggle this pref to a menu.

Properties

Name Value Summary
Value bool
The current value of this pref.

Methods

Name Value Summary
AddToggleFunction(GenericMenu) void
Adds a menu function to toggle the Animancer.Editor.BoolPref.Value of this pref.

Operators

Name Value Summary
implicit operator bool(BoolPref) bool