Table of Contents

Namespace ElectricDrill.AstraRpgFramework.Utils

Classes

BoundedValueSO

Abstract base class for values that can be bounded by minimum and maximum limits. Provides functionality to define optional min/max constraints and clamp values within those bounds.

Cache<KType, VType>

A generic cache class that provides basic caching functionality.

ComponentUtils

Extension methods for MonoBehaviour component caching.

GrowthFormulaSO

Represents a formula to calculate growth values for different levels, up to a maximum level.

InitializationUtils

Provides utility methods for initializing and refreshing collections during object setup. Contains helper methods commonly used during component initialization and validation.

IntRef

A reference to an integer value. Can either be a constant value or a reference to an IntVarSO ScriptableObject.

IntVarSO

ScriptableObject that holds an integer value. Can be used to share an integer value between different GameObjects and scenes.

LongRef

A reference to a long value. Can either be a constant value or a reference to a LongVarSO ScriptableObject.

LongVarSO

ScriptableObject that holds a long value. Can be used to share a long value between different GameObjects and scenes.

Percentage

The Percentage class represents a percentage value and provides various operators and conversions.
Implicit long to Percentage value conversion is available. To express a 100% value, use 100L.
Implicit Percentage to double conversion is available. When doing so, the percentage is automatically divided by 100.

RoundingModeExtensions

Extension methods for RoundingMode.

SerializableDictionary<TKey, TValue>

A serializable dictionary implementation that can be displayed and edited in the Unity Inspector. Provides all standard dictionary functionality while maintaining Unity serialization compatibility.

SerializableHashSet<T>

A serializable hash set implementation that can be displayed and edited in the Unity Inspector. Provides all standard hash set functionality while maintaining Unity serialization compatibility.

TypeSelectableAttribute

Custom attribute to mark fields for SerializeReference type selection. Apply this to [SerializeReference] fields to enable type selection dropdown.

TypeSelectableMenuAttribute

Declares the menu path used by the type selection dropdown when picking a concrete implementation for a [SerializeReference] field marked with TypeSelectableAttribute.

Path segments are separated by / and produce nested sub-menus (Unity's GenericMenu behavior). The concrete type's display name is automatically appended as the final segment. When the assembly declaring the type is annotated with TypeSelectableMenuPrefixAttribute, that prefix is prepended.

Types without this attribute remain at the menu root (flat behavior).

TypeSelectableMenuPrefixAttribute

Assembly-level attribute that prepends a prefix to the menu path of every type in the declaring assembly when shown in the type selection dropdown. Lets sibling/external packages be grouped under a single label without annotating each concrete class.

Apply via [assembly: TypeSelectableMenuPrefix("Modifiers")] in any file of the target assembly. The prefix is combined with any per-type TypeSelectableMenuAttribute path and the display name, e.g. "Modifiers/Conditions/Tag/TagPresent".

ValidationError

Represents a validation error that occurred during formula evaluation.

Structs

SerKeyValPair<T, U>

A serializable key-value pair structure that can be used in Unity's inspector. Provides implicit conversion to and from the standard KeyValuePair.

Interfaces

IEditorValidatable

Interface for objects that support validation events in the Unity Editor. This allows other components to subscribe and react when an object is validated (typically through OnValidate in the inspector).

IValueContainer<T>

Interface for objects that can contain and query values. Provides a standardized way to check for value containment across different value containers.

IValueProvider<KeyType, ReturnType>

Provides a method to retrieve a value based on a key.

Enums

RoundingMode

Specifies how a double value is rounded to the nearest integer.