Skip to content

Full code documentation

Bas de Reus edited this page Mar 26, 2024 · 49 revisions

This is a wiki page with the full documentation of every piece of code. Any class can be found here.

Enum extensions

This is a static class that improve the usage of enum with custom attributes.

Write by Bas

Usage

Every method it public.

Methods Return Description
GetString(Enum) string Get the string of an enum type. If not existing returns empty string
GetChar(Enum) char Get the char of an enum type. If not existing returns empty char ('\0')
GetVector2(Enum) Vector2 Get the Vector2 of an enum type. If not existing returns vector2.zero
GetVector3(Enum) Vector3 Get the Vector3 of an enum type. If not existing returns vector3.zero
GetRandomEnumValue T Retrieves a random enum value of the specified type. Returns a random enum value of type T
Vector3 use case

Vector 3 attributes

image

Enum with Vector3

image

Using the enums Vector3

image

GetRandomEnumValue use case

image

Source

Static class

EnumExtensions.cs

Attributes

  1. CharValue
  2. StringValue
  3. Vector2Value
  4. Vector3Value

Clone this wiki locally