Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
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. More...
 
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. More...
 
void CloseDocument ()
 
bool DocumentIsInCollection (int documentID)
 Checks if a particular Document is in the Player's collection More...
 
bool HasBeenRead (Document document)
 Checks if a given Document has been read by the Player More...
 
bool HasBeenRead (int documentID)
 Checks if a given Document has been read by the Player More...
 
DocumentInstance GetCollectedDocumentInstance (Document document)
 Gets the DocumentInstance class for a Document present in the Player's collection More...
 
DocumentInstance GetCollectedDocumentInstance (int ID)
 Gets the DocumentInstance class for a Document present in the Player's collection More...
 
void AddToCollection (Document document)
 Adds a Document to the Player's own collection More...
 
void AddToCollection (int documentID)
 Adds a Document to the Player's own collection More...
 
void RemoveFromCollection (Document document)
 Removes a Document from the Player's own collection More...
 
void RemoveFromCollection (int documentID)
 Removes a Document from the Player's own collection More...
 
void ClearCollection ()
 
int GetLastOpenPage (DocumentInstance documentInstance)
 Gets the page number to return to when opening a previously-read Document More...
 
void SetLastOpenPage (DocumentInstance documentInstance, int page)
 Sets the page number to return to when a given Document is next opened More...
 
PlayerData SavePlayerDocuments (PlayerData playerData)
 Updates a PlayerData class with its own variables that need saving. More...
 
void AssignPlayerDocuments (PlayerData playerData)
 Restores saved data from a PlayerData class More...
 
int[] GetCollectedDocumentIDs (int[] limitToCategoryIDs=null)
 Gets an array of ID numbers that each represent a Document held by the Player More...
 

Protected Member Functions

void GetDocumentsOnStart ()
 

Protected Attributes

DocumentInstance activeDocumentInstance
 
readonly Dictionary< int, DocumentInstancecollectedDocumentsDict = new Dictionary<int, DocumentInstance> ()
 

Properties

DocumentInstance ActiveDocumentInstance [get]
 
DocumentActiveDocument [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)

Adds a Document to the Player's own collection

Parameters
documentThe Document to add

◆ 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  ID)

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

Parameters
IDThe 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