Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.DocumentInstance Class Reference

Public Member Functions

 DocumentInstance (Document document)
 
 DocumentInstance (int id)
 
Texture2D GetPageTexture (int pageNumber)
 Gets the texture associated with a given page. This can be overridden with SetPageTexture. More...
 
void SetPageTexture (int pageNumber, Texture2D texture)
 Sets the texture associated with a given page. This will override the default. More...
 

Static Public Member Functions

static bool IsValid (DocumentInstance documentInstance)
 

Public Attributes

readonly Document Document
 
int lastOpenPage = 1
 
bool hasBeenViewed
 

Properties

int? DocumentID [get]
 
int? CategoryID [get]
 

Detailed Description

Stores data related to a Document at runtime

Constructor & Destructor Documentation

◆ DocumentInstance() [1/2]

AC.DocumentInstance.DocumentInstance ( Document  document)

A Constructore that assigns the Document directly

◆ DocumentInstance() [2/2]

AC.DocumentInstance.DocumentInstance ( int  id)

A Constructore that assigns the Document based on its ID in the Inventory Manager

Member Function Documentation

◆ GetPageTexture()

Texture2D AC.DocumentInstance.GetPageTexture ( int  pageNumber)

Gets the texture associated with a given page. This can be overridden with SetPageTexture.

Parameters
pageNumberThe number of the page, starting from 1
Returns
The page's texture

◆ SetPageTexture()

void AC.DocumentInstance.SetPageTexture ( int  pageNumber,
Texture2D  texture 
)

Sets the texture associated with a given page. This will override the default.

Parameters
pageNumberThe number of the page, starting from 1
textureThe page's new texture. If null, it will revert to its default texture

Member Data Documentation

◆ Document

readonly Document AC.DocumentInstance.Document

The linked Document

◆ hasBeenViewed

bool AC.DocumentInstance.hasBeenViewed

If True, the Document has been read by the Player

◆ lastOpenPage

int AC.DocumentInstance.lastOpenPage = 1

The index number of the page last shown

Property Documentation

◆ CategoryID

int? AC.DocumentInstance.CategoryID
get

The linked Document's category ID, or -1 if invalid

◆ DocumentID

int? AC.DocumentInstance.DocumentID
get

The linked Document's ID, or -1 if invalid