All Classes Namespaces Functions Variables Enumerations Enumerator Properties
plyGame.Item Class Reference

Items are things that characters can pick up and use More...

Inherits MonoBehaviour, and plyGame.IPersistable.

Public Types

enum  ItemLocation { Scene, Bag, Equipped }
 

Public Member Functions

override string ToString ()
 
void Save (string key)
 
void Load (string key)
 
void DeleteSaveData (string key)
 
void DisablePersistence ()
 
void PerformPickup ()
 

Static Public Member Functions

static void LoadCreate (string key)
 
static Item CreateItem (UniqueID prefabId, ItemLocation location, Vector3 pos, Quaternion rot, UniqueID withSaveKey)
 
static Item CreateItem (UniqueID prefabId, ItemLocation location, Vector3 pos, Quaternion rot, UniqueID withSaveKey, bool dropEffect, Vector3 dropForward)
 

Public Attributes

bool persistenceOn = true
 Indicate if this Item will take part in LodSave or not.
 
CommonDefinitionData def = new CommonDefinitionData()
 common data
 
UniqueID prefabId = new UniqueID()
 Unique id. All same Items will share the same ID as this is unique per Item definition/ prefab, not per placed Item.
 
int itemType = -1
 Type of this Item, as defined in Items System settings. Sword, Armour, etc.
 
int itemSubType = -1
 Sub-type of the Item ,as defined in settings. Axe, Sword, etc.
 
GameObject floorArt
 The art shown while item is not held by a character (for example when item is laying on floor)
 
GameObject heldArt
 The art used when the item is held by character.
 
int maxStack = 1
 how many of this item can be stacked in same slot in bag
 
float weight = 0f
 weight of the item when weight based system is used
 
int hSlots = 1
 number of horizontal slots the item takes up when slots based system is used
 
int vSlots = 1
 number of vertical slots the item takes up when slots based system is used
 
float autoPickupDist = 0f
 auto-pickup within this distance
 
int baseValue = 1
 base value (in currency)
 
bool isCurrency = false
 if true then this item is currency. when the player pick it up it will add a certain amount of currency rather than going into the bag like a normal item.
 
int minCurrency = 1
 when picked up a random amount can be generated between min and max
 
int maxCurrency = 1
 when picked up a random amount can be generated between min and max
 
bool canEquip = false
 can the item be equipped? For example, Sword
 
bool consumeOnUse = false
 is the item consumed when used? For example, Potions.
 
int equipSlot = -1
 indicates to which slot this can be equipped by default
 
bool freezeRotWhenDrop = false
 

Protected Member Functions

void Reset ()
 
void Awake ()
 
void Start ()
 
void LateUpdate ()
 

Properties

ItemLocation location [get, set]
 
plyBlox blox [get, set]
 
PersistableObject persistObj [get, set]
 
EventHandler_Item eventHandler [get, set]
 

Detailed Description

Items are things that characters can pick up and use