RPGlite Starter Kit  1.0.0
Starting RPG projects made easy.
Loading...
Searching...
No Matches
RPGlite.Storage Class Reference
Inheritance diagram for RPGlite.Storage:
[legend]

Public Member Functions

bool Toggle ()
 Toggles storage on or off.
 
bool SetInventory (bool state)
 Sets storage on or off.
 
void AddMoney (int amount)
 Add or subtract money from this storage.
 
void UpdateMoney (int newMoneyAmount)
 Set a specific amount of money for this storage.
 
void UpdateInventory ()
 Reloads all items based on list of itemIds.
 
void ClearInventory ()
 Removes all inventory items.
 
void PlayInteractionSound (float pitchOffset=0.0f)
 Play interaction sound from this inventory, with fixed random pitch variation.
 

Public Attributes

GameObject itemUIPrefab
 
List< int > itemIds
 
int money = 0
 
TMP_Text money_text
 
GameObject inventoryList
 

Protected Member Functions

void Start ()
 

Protected Attributes

bool inventoryOn = true
 

Properties

bool InventoryOn [get, set]
 Define if the storage is showing or not.
 

Member Function Documentation

◆ AddMoney()

void RPGlite.Storage.AddMoney ( int amount)
inline

Add or subtract money from this storage.

Parameters
amountHow much money to add. Negative values deduct money

◆ ClearInventory()

void RPGlite.Storage.ClearInventory ( )
inline

Removes all inventory items.

◆ PlayInteractionSound()

void RPGlite.Storage.PlayInteractionSound ( float pitchOffset = 0::0f)
inline

Play interaction sound from this inventory, with fixed random pitch variation.

Parameters
pitchOffsetAdd an offset to the pitch.

◆ SetInventory()

bool RPGlite.Storage.SetInventory ( bool state)
inline

Sets storage on or off.

Parameters
stateStorage on (true) or off (false).
Returns

◆ Start()

void RPGlite.Storage.Start ( )
inlineprotected

◆ Toggle()

bool RPGlite.Storage.Toggle ( )
inline

Toggles storage on or off.

Returns
Whether storage is now on (true) or off (false)

◆ UpdateInventory()

void RPGlite.Storage.UpdateInventory ( )
inline

Reloads all items based on list of itemIds.

◆ UpdateMoney()

void RPGlite.Storage.UpdateMoney ( int newMoneyAmount)
inline

Set a specific amount of money for this storage.

Parameters
newMoneyAmountHow much money this storage will have from now on.

Member Data Documentation

◆ inventoryList

GameObject RPGlite.Storage.inventoryList

◆ inventoryOn

bool RPGlite.Storage.inventoryOn = true
protected

◆ itemIds

List<int> RPGlite.Storage.itemIds

◆ itemUIPrefab

GameObject RPGlite.Storage.itemUIPrefab

◆ money

int RPGlite.Storage.money = 0

◆ money_text

TMP_Text RPGlite.Storage.money_text

Property Documentation

◆ InventoryOn

bool RPGlite.Storage.InventoryOn
getset

Define if the storage is showing or not.


The documentation for this class was generated from the following file: