![]() |
Adventure Creator
1.76.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
GVar (int[] idArray) | |
GVar (GVar assetVar) | |
int | AssignUniqueID (int[] idArray) |
Sets the internal ID to a unique number based on an array of previously-used values More... | |
void | Download (VariableLocation _location=VariableLocation.Global, Variables _variables=null) |
Sets its value to that of its linked variable (if appropriate). More... | |
void | Upload (VariableLocation _location=VariableLocation.Global, Variables _variables=null) |
Sets the value of its linked variable to its value (if appropriate). More... | |
void | BackupValue () |
void | RestoreBackupValue () |
void | SetStringValue (string newValue, int newLineID=-1) |
Sets the value if its type is String. More... | |
void | CreateRuntimeTranslations () |
string[] | GetTranslations () |
Gets the variable's translations, if they exist. More... | |
void | CopyFromVariable (GVar oldVar, VariableLocation oldLocation) |
Copies the value of another variable onto itself. More... | |
string | GetValue (int languageNumber=0) |
Returns the variable's value. More... | |
string | GetPopUpsString () |
Gets all possible PopUp values as a single string, where the values are separated by a ']' character. More... | |
bool | HasTranslations () |
Checks if the Variable is translatable. More... | |
bool | IsGlobalVariable () |
Checks if this Variable is defined under the Variable Manager's list of Global Variables More... | |
int | GetNumPopUpValues () |
Gets the number of possible values, if of the type PopUp More... | |
string | GetPopUpForIndex (int index, int language=0) |
Gets the PopUp value of a given index and language, if of type PopUp More... | |
void | AssignPreset (PresetValue presetValue) |
override string | ToString () |
virtual string | GetTranslatableString (int index) |
Gets the text to be translated, given its index. More... | |
virtual int | GetTranslationID (int index) |
Gets the translation ID of a given text index. More... | |
virtual AC_TextType | GetTranslationType (int index) |
Gets the translation type of a given text index. More... | |
void | UpdateTranslatableString (int index, string updatedText) |
int | GetNumTranslatables () |
Gets the maximum number of possible translatable texts. More... | |
virtual bool | HasExistingTranslation (int index) |
Checks if a given text index has already been assigned a unique translation ID. More... | |
virtual void | SetTranslationID (int index, int _lineID) |
Sets the translation ID of a given text index More... | |
string | GetOwner (int index) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More... | |
bool | OwnerIsPlayer (int index) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More... | |
virtual bool | CanTranslate (int index) |
Checks if a given text index can and should be translated. More... | |
string[] | GenerateEditorPopUpLabels () |
void | ShowGUI (VariableLocation location, bool canEdit, List< VarPreset > _varPresets=null, string apiPrefix="", Variables _variables=null) |
Public Attributes | |
string | label |
int | id |
VariableType | type |
string[] | popUps |
VarLink | link = VarLink.None |
string | pmVar |
bool | updateLinkOnStart = false |
bool | canTranslate = true |
int | popUpID = 0 |
int | textValLineID = -1 |
int | popUpsLineID = -1 |
string | description = "" |
bool | showInFilter |
Protected Attributes | |
int | val = 0 |
float | floatVal = 0f |
string | textVal = "" |
GameObject | gameObjectVal |
GameObjectParameterReferences | gameObjectSaveReferences = GameObjectParameterReferences.ReferenceSceneInstance |
Object | objectVal |
Vector3 | vector3Val = new Vector3 (0f, 0f, 0f) |
string[] | runtimeTranslations |
Static Protected Attributes | |
static string[] | boolType = { "False", "True" } |
Properties | |
int | IntegerValue [get, set] |
bool? | BooleanValue [get, set] |
float | FloatValue [get, set] |
string | TextValue [get, set] |
Vector3 | Vector3Value [get, set] |
GameObject? | GameObjectValue [get, set] |
bool | SavePrefabReference [get] |
Object? | UnityObjectValue [get, set] |
A data class for global and local variables. Variables are created in the Variables Manager asset file, and copied to the RuntimeVariables component when the game begins.
AC.GVar.GVar | ( | int[] | idArray | ) |
The main Constructor. An array of ID numbers is required, to ensure its own ID is unique.
AC.GVar.GVar | ( | GVar | assetVar | ) |
A Constructor that copies all values from another variable. This way ensures that no connection remains to the asset file.
int AC.GVar.AssignUniqueID | ( | int[] | idArray | ) |
Sets the internal ID to a unique number based on an array of previously-used values
idArray | An array of previously-used ID values |
>
void AC.GVar.BackupValue | ( | ) |
Backs up its value. Necessary when skipping ActionLists that involve checking variable values.
|
virtual |
Checks if a given text index can and should be translated.
index | The index of the translatable text |
Implements AC.ITranslatable.
Reimplemented in AC.InvVar.
void AC.GVar.CopyFromVariable | ( | GVar | oldVar, |
VariableLocation | oldLocation | ||
) |
Copies the value of another variable onto itself.
oldVar | The variable to copy from |
oldLocation | The location of the variable to copy (Global, Local) |
void AC.GVar.CreateRuntimeTranslations | ( | ) |
Transfers translation data from RuntimeLanguages to the variable itself. This allows it to be transferred to other variables with the 'Variable: Copy' Action.
void AC.GVar.Download | ( | VariableLocation | _location = VariableLocation.Global , |
Variables | _variables = null |
||
) |
Sets its value to that of its linked variable (if appropriate).
_location | The variable's location |
_variables | The variable's Variables component, if location = VariableLocation.Component |
int AC.GVar.GetNumPopUpValues | ( | ) |
Gets the number of possible values, if of the type PopUp
int AC.GVar.GetNumTranslatables | ( | ) |
Gets the maximum number of possible translatable texts.
Implements AC.ITranslatable.
string AC.GVar.GetOwner | ( | int | index | ) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.
index | The index of the translatable text |
Implements AC.ITranslatable.
string AC.GVar.GetPopUpForIndex | ( | int | index, |
int | language = 0 |
||
) |
Gets the PopUp value of a given index and language, if of type PopUp
index | The index of the PopUp labels |
language | The language index |
<returs>The PopUp value of a given index and language
string AC.GVar.GetPopUpsString | ( | ) |
Gets all possible PopUp values as a single string, where the values are separated by a ']' character.
|
virtual |
Gets the text to be translated, given its index.
index | The index of the translatable text |
Implements AC.ITranslatable.
Reimplemented in AC.InvVar.
|
virtual |
Gets the translation ID of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
Reimplemented in AC.InvVar.
string [] AC.GVar.GetTranslations | ( | ) |
Gets the variable's translations, if they exist.
|
virtual |
Gets the translation type of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
Reimplemented in AC.InvVar.
string AC.GVar.GetValue | ( | int | languageNumber = 0 | ) |
Returns the variable's value.
|
virtual |
Checks if a given text index has already been assigned a unique translation ID.
index | The index of the translatable text |
Implements AC.ITranslatable.
Reimplemented in AC.InvVar.
bool AC.GVar.HasTranslations | ( | ) |
Checks if the Variable is translatable.
bool AC.GVar.IsGlobalVariable | ( | ) |
Checks if this Variable is defined under the Variable Manager's list of Global Variables
bool AC.GVar.OwnerIsPlayer | ( | int | index | ) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.
index | The index of the translatable text |
Implements AC.ITranslatable.
void AC.GVar.RestoreBackupValue | ( | ) |
Restores its value from backup. Necessary when skipping ActionLists that involve checking variable values.
void AC.GVar.SetStringValue | ( | string | newValue, |
int | newLineID = -1 |
||
) |
Sets the value if its type is String.
newValue | The new value of the string |
newLineID | If >=0, the translation ID used by SpeechManager / RuntimeLanguages will be updated to this value |
|
virtual |
Sets the translation ID of a given text index
index | The index of the translatable text |
lineID | The new translation ID to assign the translatable text |
Implements AC.ITranslatable.
Reimplemented in AC.InvVar.
void AC.GVar.Upload | ( | VariableLocation | _location = VariableLocation.Global , |
Variables | _variables = null |
||
) |
Sets the value of its linked variable to its value (if appropriate).
_location | The variable's location |
_variables | The variable's Variables component, if location = VariableLocation.Component |
bool AC.GVar.canTranslate = true |
If True, the variable's value can be translated (if PopUp or String)
int AC.GVar.id |
Its internal ID number.
string AC.GVar.label |
Its editor name.
VarLink AC.GVar.link = VarLink.None |
What it links to, if a Global or Compnent Variable. A Variable can link to Options Data, or a Playmaker Variable.
string AC.GVar.pmVar |
If linked to a Playmaker Variable, the name of the PM variable.
int AC.GVar.popUpID = 0 |
The ID number of the shared popup labels, if more than zero
string [] AC.GVar.popUps |
An array of labels, if a popup.
int AC.GVar.popUpsLineID = -1 |
The translation ID number of the variables's PopUp values (if type == VariableType.PopUp), as generated by SpeechManager
int AC.GVar.textValLineID = -1 |
The translation ID number of the variable's string value (if type == VariableType.String), as generated by SpeechManager
VariableType AC.GVar.type |
Its variable type.
bool AC.GVar.updateLinkOnStart = false |
If True and the variable is linked to a custom script, the script will be referred to for the initial value.
|
protected |
Its value, if a Vector3
|
getset |
Its value, if a boolean.
|
getset |
Its value, if a float.
|
getset |
Its value, if a GameObject.
|
getset |
Its value, if an integer.
|
getset |
Its value, if a string.
|
getset |
Its value, if a Unity Object.
|
getset |
Its value, if a Vector3.