Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.RuntimeDocuments Class Reference
Inheritance diagram for AC.RuntimeDocuments:

Public Member Functions

void OnInitPersistentEngine ()
void OpenDocument (Document document)
 Opens a Document. To view it, a Menu with an Appear Type of OnViewDocument must be present in the Menu Manager.
void OpenDocument (int documentID)
 Opens a Document. To view it, a Menu with an Appear Type of OnViewDocument must be present in the Menu Manager.
void CloseDocument ()
bool DocumentIsInCollection (int documentID)
 Checks if a particular Document is in the Player's collection.
bool HasBeenRead (Document document)
 Checks if a given Document has been read by the Player.
bool HasBeenRead (int documentID)
 Checks if a given Document has been read by the Player.
DocumentInstance GetCollectedDocumentInstance (Document document)
 Gets the DocumentInstance class for a Document present in the Player's collection.
DocumentInstance GetCollectedDocumentInstance (int documentID)
 Gets the DocumentInstance class for a Document present in the Player's collection.
void AddToCollection (Document document, bool addToFront=false)
 Adds a Document to the Player's own collection.
void AddToCollection (int documentID)
 Adds a Document to the Player's own collection.
void RemoveFromCollection (Document document)
 Removes a Document from the Player's own collection.
void RemoveFromCollection (int documentID)
 Removes a Document from the Player's own collection.
void ClearCollection ()
int GetLastOpenPage (DocumentInstance documentInstance)
 Gets the page number to return to when opening a previously-read Document.
void SetLastOpenPage (DocumentInstance documentInstance, int page)
 Sets the page number to return to when a given Document is next opened.
PlayerData SavePlayerDocuments (PlayerData playerData)
 Updates a PlayerData class with its own variables that need saving.
void AssignPlayerDocuments (PlayerData playerData)
 Restores saved data from a PlayerData class.
int[] GetCollectedDocumentIDs (int[] limitToCategoryIDs=null)
 Gets an array of ID numbers that each represent a Document held by the Player.

Protected Member Functions

void GetDocumentsOnStart ()

Protected Attributes

DocumentInstance activeDocumentInstance
readonly List< DocumentInstancecollectedDocuments = new List<DocumentInstance> ()

Properties

DocumentInstance ActiveDocumentInstance [get]
Document ActiveDocument [get]

Detailed Description

This script stores information about the currently-open Document, as well as any runtime-made changes to all Documents.

Member Function Documentation

◆ AddToCollection() [1/2]

void AC.RuntimeDocuments.AddToCollection ( Document document,
bool addToFront = false )

Adds a Document to the Player's own collection.

Parameters
documentThe Document to add
addToFrontIf True, the Document will be added to the front of the collection

◆ AddToCollection() [2/2]

void AC.RuntimeDocuments.AddToCollection ( int documentID)

Adds a Document to the Player's own collection.

Parameters
documentIDThe ID of the Document to add

◆ AssignPlayerDocuments()

void AC.RuntimeDocuments.AssignPlayerDocuments ( PlayerData playerData)

Restores saved data from a PlayerData class.

Parameters
playerDataThe PlayerData class to load from

◆ ClearCollection()

void AC.RuntimeDocuments.ClearCollection ( )

Removes all Documents from the Player's own collection

◆ CloseDocument()

void AC.RuntimeDocuments.CloseDocument ( )

Closes the currently-viewed Document, if there is one

◆ DocumentIsInCollection()

bool AC.RuntimeDocuments.DocumentIsInCollection ( int documentID)

Checks if a particular Document is in the Player's collection.

Parameters
documentIDThe ID number of the Document to check for
Returns
True if the Document is in the Player's collection

◆ GetCollectedDocumentIDs()

int[] AC.RuntimeDocuments.GetCollectedDocumentIDs ( int[] limitToCategoryIDs = null)

Gets an array of ID numbers that each represent a Document held by the Player.

Parameters
limitToCategoryIDsIf non-negative, ID numbers of inventory categories to limit results to
Returns
An array of ID numbers that each represent a Document held by the Player

◆ GetCollectedDocumentInstance() [1/2]

DocumentInstance AC.RuntimeDocuments.GetCollectedDocumentInstance ( Document document)

Gets the DocumentInstance class for a Document present in the Player's collection.

Parameters
documentThe original Document, as defined in the Inventory Manager
Returns
The DocumentInstance class, if present, or null otherwise

◆ GetCollectedDocumentInstance() [2/2]

DocumentInstance AC.RuntimeDocuments.GetCollectedDocumentInstance ( int documentID)

Gets the DocumentInstance class for a Document present in the Player's collection.

Parameters
documentIDThe ID of the Document
Returns
The DocumentInstance class, if present, or null otherwise

◆ GetLastOpenPage()

int AC.RuntimeDocuments.GetLastOpenPage ( DocumentInstance documentInstance)

Gets the page number to return to when opening a previously-read Document.

Parameters
documentThe Document in question
Returns
The page number to return to when opening a previously-read Document

◆ HasBeenRead() [1/2]

bool AC.RuntimeDocuments.HasBeenRead ( Document document)

Checks if a given Document has been read by the Player.

Parameters
documentThe Document to check for
Returns
True if the Document is held by the Player and has been read

◆ HasBeenRead() [2/2]

bool AC.RuntimeDocuments.HasBeenRead ( int documentID)

Checks if a given Document has been read by the Player.

Parameters
documentIDThe ID of theDocument to check for
Returns
True if the Document is held by the Player and has been read

◆ OnInitPersistentEngine()

void AC.RuntimeDocuments.OnInitPersistentEngine ( )

This is called when the game begins, and sets up the initial state.

◆ OpenDocument() [1/2]

void AC.RuntimeDocuments.OpenDocument ( Document document)

Opens a Document. To view it, a Menu with an Appear Type of OnViewDocument must be present in the Menu Manager.

Parameters
documentThe Document to open

◆ OpenDocument() [2/2]

void AC.RuntimeDocuments.OpenDocument ( int documentID)

Opens a Document. To view it, a Menu with an Appear Type of OnViewDocument must be present in the Menu Manager.

Parameters
documentIDThe ID number of the Document to open

◆ RemoveFromCollection() [1/2]

void AC.RuntimeDocuments.RemoveFromCollection ( Document document)

Removes a Document from the Player's own collection.

Parameters
documentThe Document to remove

◆ RemoveFromCollection() [2/2]

void AC.RuntimeDocuments.RemoveFromCollection ( int documentID)

Removes a Document from the Player's own collection.

Parameters
documentIDThe ID of the Document to remove

◆ SavePlayerDocuments()

PlayerData AC.RuntimeDocuments.SavePlayerDocuments ( PlayerData playerData)

Updates a PlayerData class with its own variables that need saving.

Parameters
playerDataThe original PlayerData class
Returns
The updated PlayerData class

◆ SetLastOpenPage()

void AC.RuntimeDocuments.SetLastOpenPage ( DocumentInstance documentInstance,
int page )

Sets the page number to return to when a given Document is next opened.

Parameters
documentThe Document in question
pageThe page number to return to next time

Property Documentation

◆ ActiveDocument

Document AC.RuntimeDocuments.ActiveDocument
get

The currently-active Document

◆ ActiveDocumentInstance

DocumentInstance AC.RuntimeDocuments.ActiveDocumentInstance
get

The currently-active Document Instance