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

Contains the defined Items. More...

Inherits ScriptableObject.

Public Types

enum  StorageMethod { Unlimited, Weight, Slots }
 

Public Member Functions

bool UpdateItemCache ()
 
Item GetDefinition (UniqueID id)
 Get definition by its Id. Return null if Id is invalid or definition not found. More...
 
Item GetDefinition (string ident, plyGameObjectIdentifyingType identType)
 Get the defined by its name, custom def.ident or def.meta data. Return null if not found. More...
 
int GetDefinitionIdx (UniqueID id)
 Get an definition's index in the list by Id. Return -1 if not found. More...
 
string GetScreenName (UniqueID id)
 Return the screen name of an definition. Return "-invalid-" if not found. More...
 
string[] GetNames ()
 Returns a list of names of all defined items. More...
 

Public Attributes

List< GameObject > itemFabs = new List<GameObject>()
 List of all defined item prefabs.
 
List< Itemitems = new List<Item>(0)
 Runtime access to defined Items.
 
StorageMethod storageMethod = StorageMethod.Weight
 
float autoPickItemDisableDistance = 20f
 items that can be auto picked up is disabled when further than this from player
 
List< ItemTypeitemTypes = new List<ItemType>(1)
 The defined Item Types.
 
List< string > equipSlots = new List<string>(1)
 The defined Equip Slots names.
 
bool runtimeCreatedItemsPersist = true
 Should Items created at runtime be restored after scene changes?
 

Properties

static ItemsAsset Instance [get]
 Provide access to asset at runtime More...
 

Detailed Description

Contains the defined Items.

Member Function Documentation

Item plyGame.ItemsAsset.GetDefinition ( UniqueID  id)

Get definition by its Id. Return null if Id is invalid or definition not found.

Item plyGame.ItemsAsset.GetDefinition ( string  ident,
plyGameObjectIdentifyingType  identType 
)

Get the defined by its name, custom def.ident or def.meta data. Return null if not found.

int plyGame.ItemsAsset.GetDefinitionIdx ( UniqueID  id)

Get an definition's index in the list by Id. Return -1 if not found.

string [] plyGame.ItemsAsset.GetNames ( )

Returns a list of names of all defined items.

string plyGame.ItemsAsset.GetScreenName ( UniqueID  id)

Return the screen name of an definition. Return "-invalid-" if not found.

Property Documentation

ItemsAsset plyGame.ItemsAsset.Instance
staticget

Provide access to asset at runtime