Definitto
1.1.0
The essential defines manager for the Unity game engine. API reference.
|
A single define in the list. More...
Public Member Functions | |
void | ClearCache () |
Clears the cache for the define. More... | |
Define (Defines owner, string name) | |
Create a new define with the specified name . More... | |
Define (string name) | |
Initializes a new instance of the Turbanov.Toolworks.Definitto.Define class without owner. More... | |
bool | IsEnabled (IEnumerable< BuildTypeId > buildTypeIds, IEnumerable< PlatformId > platformTypes, AggregationPolicy policy=AggregationPolicy.All, bool raw=false) |
Check if the define is enabled for specified build types on specified platforms. More... | |
bool | IsEnabled (BuildTypeId buildTypeId, PlatformId platformId, AggregationPolicy policy=AggregationPolicy.All, bool raw=false) |
Is the define active for the specified build type on the specified platform? More... | |
bool | IsEnabled (BuildCategoryId buildCategoryId, PlatformId platformId, AggregationPolicy policy=AggregationPolicy.All, bool raw=false) |
Determines whether this instance is enabled for the specified build category and platform. More... | |
bool | IsEnabled (BuildTypeId buildTypeId, PlatformCategoryId platformCategoryId, AggregationPolicy policy=AggregationPolicy.All, bool raw=false) |
Determines whether this instance is enabled for the specified build type and platform category. More... | |
bool | IsEnabled (BuildCategoryId buildCategoryId, PlatformCategoryId platformCategoryId, AggregationPolicy policy=AggregationPolicy.All, bool raw=false) |
Determines whether this instance is enabled for the specified build category and platform category. More... | |
bool | CanBeDisabled (BuildTypeId buildTypeId, PlatformId platformId, bool raw=false) |
Determines whether this instance can be disabled for the specified buildTypeId and platformId . More... | |
void | SetEnabled (IEnumerable< BuildTypeId > buildTypeIds, IEnumerable< PlatformId > platformTypes, bool enabled=true, bool raw=false) |
Set define active/inactive for the build type and platform. More... | |
void | SetEnabled (BuildTypeId buildTypeId, PlatformId platformType, bool enabled=true, bool raw=false) |
Set define active/inactive for the build type and platform. More... | |
void | SetEnabled (BuildCategoryId buildCategoryId, PlatformId platformId, bool enabled=true, bool raw=false) |
Set the define active/inactive for the build category and platform. More... | |
void | SetEnabled (BuildTypeId buildTypeId, PlatformCategoryId platformCategoryId, bool enabled=true, bool raw=false) |
Set define active/inactive for the build type and platform category. This method is for Editor only. More... | |
void | SetEnabled (BuildCategoryId buildCategoryId, PlatformCategoryId platformCategoryId, bool enabled=true, bool raw=false) |
Set define active/inactive for the build category and the platform category. More... | |
Static Public Member Functions | |
static bool | IsNameValid (string name) |
Test if a name is a valid define name. More... | |
Public Attributes | |
const string | NameProp = "_Name" |
The name of the name property. More... | |
Properties | |
string | Name [get, set] |
The name of the constant. The setter is available only in the Editor mode. More... | |
ReadOnlyCollection< DefineState > | States [get] |
The states for which the define is active. More... | |
bool | IsMuted [get, set] |
Is the define currently muted? More... | |
DefineStateEvent | StateChanged [get] |
The define was changed in some way for a state. More... | |
DefineNameEvent | NameChanged [get] |
An event is generated when the name of the define was changed. The second argument is the former name of the define. More... | |
DefineEvent | IsMutedChanged [get] |
An event is generated when the muted status of the define was changed. More... | |
Defines | Owner [get, set] |
The owning defines list. The setter is only for internal usage. More... | |
bool | IsValid [get] |
Is the define valid? More... | |
bool | IsBuiltIn [get] |
Is the define built-in into Unity? More... | |
bool | IsActive [get] |
Determines whether this define is enabled under the currently active build type and platform. If you want to check the define state for specific platform use the Define.IsEnabled(BuildTypeId, PlatformId, AggregationPolicy) method and its overloads. More... | |
A single define in the list.
Turbanov.Toolworks.Definitto.Define.Define | ( | Defines | owner, |
string | name | ||
) |
Create a new define with the specified name .
owner | The owning list of the define. |
name | The name of the define. May be invalid, but it won't be considered enabled, until it becomes valid. |
Turbanov.Toolworks.Definitto.Define.Define | ( | string | name | ) |
Initializes a new instance of the Turbanov.Toolworks.Definitto.Define class without owner.
name | Name. |
bool Turbanov.Toolworks.Definitto.Define.CanBeDisabled | ( | BuildTypeId | buildTypeId, |
PlatformId | platformId, | ||
bool | raw = false |
||
) |
Determines whether this instance can be disabled for the specified buildTypeId and platformId .
The define can't be disabled, if it is built-in and is active for platform and build type.
This method is for Editor mode only.
true
if this instance can be disabled; otherwise, false
.void Turbanov.Toolworks.Definitto.Define.ClearCache | ( | ) |
Clears the cache for the define.
bool Turbanov.Toolworks.Definitto.Define.IsEnabled | ( | IEnumerable< BuildTypeId > | buildTypeIds, |
IEnumerable< PlatformId > | platformTypes, | ||
AggregationPolicy | policy = AggregationPolicy.All , |
||
bool | raw = false |
||
) |
Check if the define is enabled for specified build types on specified platforms.
Even if the define is enabled for supplied state, this function will return false
, unless the raw is set to true
.
true
if this instance is enabled; otherwise, false
.bool Turbanov.Toolworks.Definitto.Define.IsEnabled | ( | BuildTypeId | buildTypeId, |
PlatformId | platformId, | ||
AggregationPolicy | policy = AggregationPolicy.All , |
||
bool | raw = false |
||
) |
Is the define active for the specified build type on the specified platform?
This function uses a fast cache internally, whenever possible.
Even if the define is enabled for supplied state, this function will return false
, unless the raw is set to true
.
true
if this instance is enabled; otherwise, false
.buildTypeId | The build type to match against. |
platformId | The platform to match against. |
policy | In case buildTypeId is BuildTypeId.All or platformId is PlatformId.All, the policy to use when aggregating the define states. |
raw | Should the IsMuted and IsValid statuses be ignored? |
bool Turbanov.Toolworks.Definitto.Define.IsEnabled | ( | BuildCategoryId | buildCategoryId, |
PlatformId | platformId, | ||
AggregationPolicy | policy = AggregationPolicy.All , |
||
bool | raw = false |
||
) |
Determines whether this instance is enabled for the specified build category and platform.
Even if the define is enabled for supplied state, this function will return false
, unless the raw is set to true
.
true
if this instance is enabled; otherwise, false
.bool Turbanov.Toolworks.Definitto.Define.IsEnabled | ( | BuildTypeId | buildTypeId, |
PlatformCategoryId | platformCategoryId, | ||
AggregationPolicy | policy = AggregationPolicy.All , |
||
bool | raw = false |
||
) |
Determines whether this instance is enabled for the specified build type and platform category.
Even if the define is enabled for supplied state, this function will return false
, unless the raw is set to true
.
true
if this instance is enabled; otherwise, false
.bool Turbanov.Toolworks.Definitto.Define.IsEnabled | ( | BuildCategoryId | buildCategoryId, |
PlatformCategoryId | platformCategoryId, | ||
AggregationPolicy | policy = AggregationPolicy.All , |
||
bool | raw = false |
||
) |
Determines whether this instance is enabled for the specified build category and platform category.
Even if the define is enabled for supplied state, this function will return false
, unless the raw is set to true
.
true
if this instance is enabled; otherwise, false
.
|
static |
Test if a name is a valid define name.
name | The name to analyze. |
void Turbanov.Toolworks.Definitto.Define.SetEnabled | ( | IEnumerable< BuildTypeId > | buildTypeIds, |
IEnumerable< PlatformId > | platformTypes, | ||
bool | enabled = true , |
||
bool | raw = false |
||
) |
Set define active/inactive for the build type and platform.
Changing the define's state during the Play mode is not allowed.
void Turbanov.Toolworks.Definitto.Define.SetEnabled | ( | BuildTypeId | buildTypeId, |
PlatformId | platformType, | ||
bool | enabled = true , |
||
bool | raw = false |
||
) |
Set define active/inactive for the build type and platform.
Changing the define's state during the Play mode is not allowed.
Changing the states of a muted define are also not allowed, unless raw is set to true
.
void Turbanov.Toolworks.Definitto.Define.SetEnabled | ( | BuildCategoryId | buildCategoryId, |
PlatformId | platformId, | ||
bool | enabled = true , |
||
bool | raw = false |
||
) |
void Turbanov.Toolworks.Definitto.Define.SetEnabled | ( | BuildTypeId | buildTypeId, |
PlatformCategoryId | platformCategoryId, | ||
bool | enabled = true , |
||
bool | raw = false |
||
) |
void Turbanov.Toolworks.Definitto.Define.SetEnabled | ( | BuildCategoryId | buildCategoryId, |
PlatformCategoryId | platformCategoryId, | ||
bool | enabled = true , |
||
bool | raw = false |
||
) |
Set define active/inactive for the build category and the platform category.
This method is for Editor only.
const string Turbanov.Toolworks.Definitto.Define.NameProp = "_Name" |
The name of the name property.
|
get |
Determines whether this define is enabled under the currently active build type and platform. If you want to check the define state for specific platform use the Define.IsEnabled(BuildTypeId, PlatformId, AggregationPolicy) method and its overloads.
true
if the define is currently enabled; otherwise, false
.
|
get |
Is the define built-in into Unity?
true
if this instance is built in; otherwise, false
.
|
getset |
Is the define currently muted?
The semantic behind muting a define is as if it's no longer in the list, but still occupies its place (has an index). So methods like Defines.Find(string, bool) won't find it by default. Use the raw
parameter to query and change the muted defines. As the muted define still has its index it can be referred by indexing operators of Defines.
The define can be muted to disable it globally for all the build types and platforms. The internal list of enabled states is actually preserved, so you can un-mute the define later, to get the former states.
|
get |
An event is generated when the muted status of the define was changed.
|
get |
Is the define valid?
Invalid defines can't have their states changed, unless you use the raw
parameter in methods like Define.SetEnabled(BuildTypeId, PlatformId, bool, bool)
|
getset |
The name of the constant. The setter is available only in the Editor mode.
|
get |
An event is generated when the name of the define was changed. The second argument is the former name of the define.
|
getset |
The owning defines list. The setter is only for internal usage.
|
get |
The define was changed in some way for a state.
|
get |
The states for which the define is active.