PerObjectNamedBooleans Class Reference

Allows each unique Unity.Object to store it's own key/boolean pair.

Static Public Member Functions

static void ClearHashCodeFile ()
 Deletes all files in the current directory that end with fileNameConst. This will remove all saved foldout states.
 
static bool GetBool (object lookupObject, string keyName)
 Return the boolean value of the name key , "in" the object provided. Calls cleanup function, when necessary.
 
static bool GetBool (UniqueStringID key)
 Returns the boolean value of the provided key.
 
static bool GetFoldoutState (SerializedProperty property)
 If the property is a valid reference, returns its isExpanded (bool) member. returns false if property==null.
 
static void Init ()
 This function will assign the load and save functions to the appropriate unity callbacks
 
static void PopSerializedPropertyExtendedPathInfo ()
 When ascending a level, from the sub-property of a serializProperty, after displaying/processing it, this function is used to recover the current property.
 
static void PushSerializedPropertyExtendedPathInfo (string extendedPath)
 When descending a level, into the sub properties of a SerializedProperty, this function is called to record the path of the current property. Pop is used, when ascending, to recover it.
 
static void Reset ()
 Deletes all existing key/value pairs. Resets the cleanup timer.
 
static void SetBool (object lookupObject, string keyName, bool value)
 This function will set the boolean value paired with the provided key, to the provided value. If the key does not exist in the dictionary yet, it will be created.
 
static void SetBool (UniqueStringID key, bool value)
 This function will set the boolean value paired with the provided key, to the provided value. If the key does not exist in the dictionary yet, it will be created.
 
static void SetFoldoutState (SerializedProperty property, bool state)
 Set the foldout state for the provided SerializedProperty. Also sets the state in the dictionary if SerializedPropertiesOverride is true.
 
static bool TryGetBool (UniqueStringID key, ref bool boolState)
 Get the state of the bool, and creates it if the key dos not exist yet. the value of the bool is put in the ref parameter. returns true if key exists, false if it needed to be created.
 
static void WriteFileForCurrentSceneHashCodeDictionary ()
 Stores the boolean data for all elements in the dictionary, in a file in the current directory (project directory). The filename will be prepended with the name of the active scene.
 
static void WriteFileForHashCodeDictionary (string sceneName=null)
 Stores the boolean data for all elements in the dictionary, in a file in the current directory (project directory). The filename will be prepended with the optional sceneName parameter, of the active scene name if no parameter is provided.
 

Static Public Attributes

static float cleanupTimeDelay
 This timer specifies how often a cleanup of the dictionary should run.
 
static bool ObjectBased
 If this value is true, keys will be processed using the objects unique ID number, as part of the key. Use this option for each object to store it's own key/value pair. Operates similar to SerializedProperty.isExpanded but does not require a serializedProperty. If this value is false, keys will be processed using the objects non-unique type name, as part of the key. Use this option for each class of object's to store a single, common, key/value pair.
 
static float removalTimeDelay
 This timer specifies how long since last access, before the entry is removed.
 
static bool SerializedPropertiesOverride
 If this value is true, SerializedProperties pass to this function will not use the internal isExpanded value, but rather the value specified by PerObjectNamedBooleans (which may be by type). If this value is false, SerializedProperties pass to this function will return it's internal isExpanded value;