Simple inventory script for the Quest Machine demo. More...
Classes | |
class | SaveData |
class | Slot |
Public Types | |
enum | ItemType { Carrot = 0 , Wand = 1 , Coin = 2 } |
Public Member Functions | |
override void | Awake () |
override void | Start () |
override void | OnEnable () |
override void | OnDisable () |
void | AddItem (int index) |
void | RemoveItem (int index) |
void | ModifyItemCount (int index, int delta) |
void | SetItemCount (int index, int count) |
int | GetItemCount (int index) |
void | UseItem (int index) |
void | OnMessage (MessageArgs messageArgs) |
Handles a message that the message handler is listening for. | |
override string | RecordData () |
override void | ApplyData (string data) |
Public Member Functions inherited from PixelCrushers.Saver | |
virtual void | Reset () |
virtual void | OnDestroy () |
string | RecordData () |
This method should return a string that represents the data you want to save. | |
void | ApplyData (string s) |
This method should process the string representation of saved data and apply it to the current state of the game. | |
virtual void | ApplyDataImmediate () |
If the Saver needs to pull data from the Save System immediately after loading a scene, instead of waiting for ApplyData to be called at it its normal time, it can implement this method. | |
virtual void | OnBeforeSceneChange () |
The Save System will call this method before scene changes. | |
virtual void | OnRestartGame () |
The Save System will call this method when restarting the game. | |
Public Attributes | |
Slot[] | slots |
GameObject | wandBarrel |
EntityType | wandEntityType |
DomainType | playerInventoryDomainType |
Properties | |
static int | CarrotSlot [get] |
static int | WandSlot [get] |
static int | CoinSlot [get] |
int | usingIndex [get] |
Properties inherited from PixelCrushers.Saver | |
bool | appendSaverTypeToKey [get, set] |
Append the name of this saver type to the key. | |
virtual string | key [get, set] |
Save data under this key. | |
string | _internalKeyValue [get, set] |
Accesses the internal key value. | |
virtual bool | saveAcrossSceneChanges [get, set] |
Save when changing scenes to be able to restore saved state when returning to scene. | |
virtual bool | restoreStateOnStart [get, set] |
Additional Inherited Members | |
Protected Attributes inherited from PixelCrushers.Saver | |
string | m_runtimeKey = null |
Simple inventory script for the Quest Machine demo.
This script is very specific to the demo. Don't use it as a basis for a generalized inventory system. However, you can examine how it implements Saver to save the inventory in saved games, and how it uses the Message System to handle adding and removing items.
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from PixelCrushers.Saver.
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from PixelCrushers.Saver.
|
inlinevirtual |
Reimplemented from PixelCrushers.Saver.
|
inline |
Handles a message that the message handler is listening for.
messageArgs | The message that was sent to the MessageSystem. |
Implements PixelCrushers.IMessageHandler.
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from PixelCrushers.Saver.
|
inline |
DomainType PixelCrushers.QuestMachine.Demo.DemoInventory.playerInventoryDomainType |
Slot [] PixelCrushers.QuestMachine.Demo.DemoInventory.slots |
GameObject PixelCrushers.QuestMachine.Demo.DemoInventory.wandBarrel |
EntityType PixelCrushers.QuestMachine.Demo.DemoInventory.wandEntityType |
|
staticget |
|
staticget |
|
get |
|
staticget |