UnityToolbox
Brief documentation for all existing scripts.
 
Loading...
Searching...
No Matches
UnityToolbox.Item.ItemInstance Class Reference

An instanciated item, created from an ItemDefinition.

Inheritance diagram for UnityToolbox.Item.ItemInstance:
Saveable

Public Member Functions

object GetValueForField (string fieldName)
 
override bool Equals (object other)
 
override int GetHashCode ()
 
void Click ()
 
- Public Member Functions inherited from Saveable
void Save ()
 Defines all data to be serialized by the SaveGameManager.
 
void Load ()
 Loads all data, deserialized by the SaveGameManager.
 
void OnValidate ()
 

Public Attributes

string IconPath
 
int MaxStackCount
 
- Public Attributes inherited from Saveable
ResourceData PrefabData
 The date which is used to serialize a reference to the Prefab.
 

Protected Member Functions

override void LoadData (GameData data)
 Is called after the base data is loaded in Load. Allows additional data to be deserialized.
 
override List< GameDataSaveData ()
 Is called on Save. Allows the definition of all additional GameData to be serialized.
 
override void OnObjectDeleted ()
 A method called on deletion, that is that the object is removed from the save game and destroyed. It is not called when destroyed but saved.
 
abstract void LoadData (GameData data)
 Is called after the base data is loaded in Load. Allows additional data to be deserialized.
 
abstract List< GameDataSaveData ()
 Is called on Save. Allows the definition of all additional GameData to be serialized.
 
abstract void OnObjectDeleted ()
 A method called on deletion, that is that the object is removed from the save game and destroyed. It is not called when destroyed but saved.
 

Protected Attributes

string _itemName
 
Sprite _icon
 
- Protected Attributes inherited from Saveable
bool _removeFromSaveOnDelete
 

Properties

InventoryBase Inventory [get, set]
 
string ItemName [get, set]
 
Sprite Icon [get, set]
 
string Indentifier [get, set]
 
Type ItemType [get, set]
 
HashSet< ItemFieldItemFields [get, set]
 
- Properties inherited from Saveable
string ID [get, set]
 A unique ID.
 
bool InEditor [get]
 Whether the gameobject is found in the scene initally. Or created dynamically.
 

Member Function Documentation

◆ Click()

void UnityToolbox.Item.ItemInstance.Click ( )

◆ Equals()

override bool UnityToolbox.Item.ItemInstance.Equals ( object  other)

◆ GetHashCode()

override int UnityToolbox.Item.ItemInstance.GetHashCode ( )

◆ GetValueForField()

object UnityToolbox.Item.ItemInstance.GetValueForField ( string  fieldName)

◆ LoadData()

override void UnityToolbox.Item.ItemInstance.LoadData ( GameData  data)
protectedvirtual

◆ OnObjectDeleted()

override void UnityToolbox.Item.ItemInstance.OnObjectDeleted ( )
protectedvirtual

Implements Saveable.

References InventoryBase.RemoveItem().

◆ SaveData()

override List< GameData > UnityToolbox.Item.ItemInstance.SaveData ( )
protectedvirtual

Member Data Documentation

◆ _icon

Sprite UnityToolbox.Item.ItemInstance._icon
protected

◆ _itemName

string UnityToolbox.Item.ItemInstance._itemName
protected

◆ IconPath

string UnityToolbox.Item.ItemInstance.IconPath

◆ MaxStackCount

int UnityToolbox.Item.ItemInstance.MaxStackCount

Referenced by BoundInventory.AddItem().

Property Documentation

◆ Icon

Sprite UnityToolbox.Item.ItemInstance.Icon
getset

◆ Indentifier

string UnityToolbox.Item.ItemInstance.Indentifier
getset

◆ Inventory

InventoryBase UnityToolbox.Item.ItemInstance.Inventory
getset

◆ ItemFields

HashSet<ItemField> UnityToolbox.Item.ItemInstance.ItemFields
getset

◆ ItemName

string UnityToolbox.Item.ItemInstance.ItemName
getset

◆ ItemType

Type UnityToolbox.Item.ItemInstance.ItemType
getset