Table of Contents

Namespace Gamelogic.Extensions

This namespace contains classes that are meant to extend Unity in basic ways to make it easier to program games.

Classes

Clock

Represents a clock that expires after a given time.

ColorExtensions

Provides some utility functions for Colors.

ColorList

An InspectorList of type Color.

ColorPopupAttribute

An attribute used to mark a color field that should be drawn as a popup list in the Unity editor.

CommentAttribute

Used to mark a field to add a comment above the field in the inspector.

DiskCache<TKey, TValue>

A cache maintained on disk.

DummyAttribute

Used to mark the last field in a MonoBehaviour as a dummy so that it is not drawn. This is useful to add a decorator that should be displayed below all fields.

FixedSizeMemoryCache<TKey, TValue>

A cache maintained in memory that stays fixed in size.

FloatList

An InspectorList of type float.

FpsCounter

Component for displaying the median frame time, maximum frame time, and frame rate.

GLDebug

Class that contains methods useful for debugging. All methods are only compiled if the DEBUG symbol is defined.

GLMathf

Methods for additional math functions.

GLMonoBehaviour

Provides some additional functions for MonoBehaviour.

GLPlayerPrefs

An alternative to PlayerPrefs that provides methods for setting bool and array preferences.

GLRandom

Some convenience functions for random bools and integers.

GameObjectExtensions

Provides useful extension methods for GameObjects.

Geometry

Provides utility methods for doing geometry.

HashPool<T>

A light-weight pool class for objects that can be hashed.

HighlightAttribute

Mark simple types to be highligted in the inspector.

ImageExtensions

Provides extension methods for Unity's Image class.

ImplementationFactory<TBase>

A factory class for creating instances of types derived from TBase.

ImplementationFactory<T1, TBase>

A factory class for creating instances of types derived from TBase.

ImplementationFactory<T1, T2, TBase>

A factory class for creating instances of types derived from TBase.

ImplementationFactory<T1, T2, T3, TBase>

A factory class for creating instances of types derived from TBase.

ImplementationFactory<T1, T2, T3, T4, TBase>

A factory class for creating instances of types derived from TBase.

InspectorButtonAttribute

Gamelogic.Extensions.Editor.Internal.GLEditor`1.DrawInspectorButtons draws a button for each method marked with this attribute. This is also used by GLMonoBehaviourEditor.

InspectorFlagsAttribute

Mark fields that should be displayed as bit field mask in the inspector

InspectorList

The base class for the generic InspectorList. This class exists so that a single property drawer can be used for all subclasses.

InspectorList<T>

Exactly the same as generic List, but has a custom property drawer that draws a re-orderable list in the inspector.

IntList

An InspectorList of type int.

IntPopupAttribute

An attribute used to mark an int field that should be drawn as a popup list in the Unity editor.

LabelFieldAttribute

Specifies a field to use as label for an item in the inspector. This is especially useful for arrays of compound types.

LayerPopupAttribute

An attribute used to mark a string field that should be drawn as a popup list of layers in the Unity editor.

LayeredCache<TKey, TValue>

Represents a cache made out of two layers: a fast primary cache and a slow secondary cache. Things requested that are in the slow cache gets moved to the fast cache, and the oldest item in the fast cache moves to the slow cache.

New things are always added to the primary cache. The oldest item is moved to the slow cache if the primary cache is full.

LifeCycleEventExtensions

Provides extension methods for LifeCycleEvent.

MinMaxFloat

Class for representing a bounded range.

MinMaxInt

Class for representing a bounded range.

MinMaxRangeAttribute

Use this attribute to specify the range for a MinMaxFloat field, property, parameter or return value.

MonoBehaviourExtensions

Provides useful extension methods for MonoBehaviours.

MonoBehaviourList

An InspectorList of type MonoBehaviour.

MonoBehaviourPool<T>

A pool suitable for MonoBehaviour objects that can be instantiated from a given prefab.

NonNegativeAttribute

Mark numeric values that should always be non-negative.

NotImplementedByException

A version of NotImplementedException that takes the throwing type as argument. This is useful in class hierarchies where methods are meant to be overridden by derived types but cannot be made abstract (for example, because of Unity limitations). The exception, when thrown, indicates which class should have implemented the method, but hasn't.

ObjectList

An InspectorList of type Object.

ObservedValue<T>

Wrapper that can raise an event when a value changes.

Optional

The base class of the generic Optional class.

OptionalFloat

Represents an optional float value.

OptionalGameObject

Represents an optional GameObject.

OptionalInt

Represents an optional int value.

OptionalMonoBehaviour

Represents an optional MonoBehaviour.

OptionalString

Represents an optional string value.

OptionalVector2

Represents an optional Vector2 value.

OptionalVector3

Represents an optional Vector3 value.

Optional<T>

Useful for displaying optional values in the inspector.

PoolExtensions
Pool<T>

A light-weight pool class for objects that cannot be hashed.

PopupListAttribute

The base class for all popup list attributes.

PopupListData

Data used to draw a popup list.

PopupListData<T>

Data used to draw a popup list of a specific type.

PositiveAttribute

Mark fields that should always be positive with this attribute.

PropertyDrawerData

Contains static variables and methods that are used by the property drawers.

PushdownAutomaton<TLabel>

This class is a state machine that has the ability to remember previous states and transition back to them (FIFO).

ReadOnlyAttribute

Used to mark inspectable fields as read-only (that is, making them uneditable, even if they are visible).

ResourceNotFoundException

Thrown when trying to load a resource (using Load(string) and variants) but the resource is not found.

ScreenshotTaker

Provides a generic implementation of a singleton-like pattern for MonoBehaviour classes. This class automatically searches for an existing instance in the scene or logs an error if none or more than one are found.

SeparatorAttribute
Singleton

Provides support for Singleton<T>.

SingletonSpawner<T>
Singleton<T>

Provides a generic implementation of a singleton-like pattern for MonoBehaviour classes. This class automatically searches for an existing instance in the scene or logs an error if none or more than one are found.

StateMachine<TLabel>

A lightweight state machine.

StateTracker<TStateData>

Tracks a number of states. Events are raised when any state is started, and when all has stopped.

StringList

An InspectorList of type string.

StringPopupAttribute

Used to mark a string field that should be drawn as a popup list.

TagPopupAttribute

An attribute used to mark a string field that should be drawn as a popup list of tags in the Unity editor.

ThrowHelper

Class that provides helper methods for throwing exceptions.

TimedStateTracker<TStateData>

The same as StateTracker, but states can also time out.

TransformExtensions

Contains useful extensions for Select.

TypeArgumentException

Thrown when a method is called with illegal type parameters, or a class is constructed with illegal type parameters.

UnsafePool<T>

An unsafe pool class that is used for benchmarking.

ValidateMatchRegularExpressionAttribute

Marks a string field to indicate it should match a regular expression.

ValidateNotEmptyAttribute

Marks a string field that should not be empty.

ValidateNotNegativeAttribute

Attribute used to mark fields that should not be negative.

ValidateNotNullAttribute

Attribute used to mark fields that should not be null.

ValidateNotWhiteSpaceOrEmpty

Marks a string field that should not be empty or whitespace.

ValidatePositiveAttribute

Attribute used to mark fields that should be positive.

ValidateRangeAttribute

Attribute used to mark fields that should have a specific range.

ValidationAttribute

The base class for properties that can be validated.

ValueSnapshot<T>

Represents a snapshot of a value, capturing its current and previous states.

Vector2List

An InspectorList of type Vector2.

Vector3List

An InspectorList of type Vector3.

Vector4List

An InspectorList of type Vector4.

VectorExtensions

Contains useful extension methods for vectors.

WarningIfNullAttribute

Mark fields in a MonoBehaviour with this attribute to give a specific warning when the field is not set.

Interfaces

ICache<TKey, TValue>

A data structure that can be used as a cache.

IPoolObject<T>
IPool<T>

Represents a pool of objects, with the idea to reuse objects instead of creating and destroying them.

IRandom

Represents a random generator.

IStateToken<TStateData>

When a new state is started in a tracker, a token is created that wraps custom data, and can be used to stop the state later.

Enums

LifeCycleEvent

Flags for Unity lifecycle events.

Singleton.FindResult

The result of the search for an instance of the singleton.

ValuesRetrievalMethod

How the values for the popup list should be retrieved.