Adventure Creator  1.74.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2019
AC.Objective Class Reference
Inheritance diagram for AC.Objective:
AC.ITranslatable

Public Member Functions

 Objective (int[] idArray)
 
ObjectiveState GetState (int stateID)
 Gets a state with a particular ID number More...
 
string GetTitle (int languageNumber=0)
 Gets the objective's title text in a given language More...
 
string GetDescription (int languageNumber=0)
 Gets the objective's description text in a given language More...
 
void ShowGUI (string apiPrefix)
 
int StateSelectorList (int selectedID, string label="State:")
 
string[] GenerateEditorStateLabels ()
 
string GetTranslatableString (int index)
 Gets the text to be translated, given its index. More...
 
int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
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...
 
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID. More...
 
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...
 
bool CanTranslate (int index)
 Checks if a given text index can and should be translated. More...
 

Public Attributes

int ID
 
int titleLineID = -1
 
string description
 
int descriptionLineID = -1
 
bool perPlayer = false
 
Texture2D texture
 
List< ObjectiveStatestates
 
bool lockStateWhenComplete = true
 
bool lockStateWhenFail = true
 

Protected Member Functions

int[] GetStateIDArray ()
 
void SideStateMenu ()
 
void StateCallback (object obj)
 
void MoveStateToTop (int a1)
 
void MoveStateToBottom (int a1)
 
void SwapStates (int a1, int a2)
 

Protected Attributes

string title
 
int sideState
 
int selectedState
 
Vector2 scrollPos
 
bool showStateGUI = true
 

Properties

string Title [get, set]
 
int NumStates [get]
 

Detailed Description

Stores data for an Objective, which can be viewed/read in a Menu

Member Function Documentation

◆ CanTranslate()

bool AC.Objective.CanTranslate ( int  index)

Checks if a given text index can and should be translated.

Parameters
indexThe index of the translatable text
Returns
True if the text can and should be translated

Implements AC.ITranslatable.

◆ GetDescription()

string AC.Objective.GetDescription ( int  languageNumber = 0)

Gets the objective's description text in a given language

Parameters
languageNumberThe language index, where 0 = the game's default language
Returns
The description text

◆ GetNumTranslatables()

int AC.Objective.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOwner()

string AC.Objective.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.

Parameters
indexThe index of the translatable text
Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetState()

ObjectiveState AC.Objective.GetState ( int  stateID)

Gets a state with a particular ID number

The ID number of the state to get

Returns
The Objective state

◆ GetTitle()

string AC.Objective.GetTitle ( int  languageNumber = 0)

Gets the objective's title text in a given language

Parameters
languageNumberThe language index, where 0 = the game's default language
Returns
The title text

◆ GetTranslatableString()

string AC.Objective.GetTranslatableString ( int  index)

Gets the text to be translated, given its index.

Parameters
indexThe index of the translatable text
Returns
The text to be translated

Implements AC.ITranslatable.

◆ GetTranslationID()

int AC.Objective.GetTranslationID ( int  index)

Gets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation ID of the text

Implements AC.ITranslatable.

◆ GetTranslationType()

AC_TextType AC.Objective.GetTranslationType ( int  index)

Gets the translation type of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation type of a given text index.

Implements AC.ITranslatable.

◆ HasExistingTranslation()

bool AC.Objective.HasExistingTranslation ( int  index)

Checks if a given text index has already been assigned a unique translation ID.

Parameters
indexThe index of the translatable text
Returns
True if the text has been assigned a unique translation ID

Implements AC.ITranslatable.

◆ OwnerIsPlayer()

bool AC.Objective.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.

Parameters
indexThe index of the translatable text
Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ SetTranslationID()

void AC.Objective.SetTranslationID ( int  index,
int  lineID 
)

Sets the translation ID of a given text index

Parameters
indexThe index of the translatable text
lineIDThe new translation ID to assign the translatable text

Implements AC.ITranslatable.

Member Data Documentation

◆ description

string AC.Objective.description

An overall description for the objective

◆ descriptionLineID

int AC.Objective.descriptionLineID = -1

The translation ID for the description text, generated by the Speech Manager

◆ ID

int AC.Objective.ID

A unique identifier

◆ lockStateWhenComplete

bool AC.Objective.lockStateWhenComplete = true

If True, the state cannot be changed once it is considered complete

◆ lockStateWhenFail

bool AC.Objective.lockStateWhenFail = true

If True, the state cannot be changed once it is considered failed

◆ perPlayer

bool AC.Objective.perPlayer = false

If True, and player switching is enabled, then this Objective's state will be limited to the current Player

◆ states

List<ObjectiveState> AC.Objective.states

A list of all possible states the Objective can be

◆ texture

Texture2D AC.Objective.texture

An associated texture

◆ titleLineID

int AC.Objective.titleLineID = -1

The translation ID for the title text, generated by the Speech Manager

Property Documentation

◆ NumStates

int AC.Objective.NumStates
get

How many states the objective can take

◆ Title

string AC.Objective.Title
getset

The objective's title