Game Module Repository

v4.0.2

The GameModuleRepository object will be automatically created and populated. This needs to be in a "Resources" folder. Best practice: Do not move its location.

You can use this to get Game Module objects (Scriptable Objects).

Access GameModuleRepository from anywhere:

GameModuleRepository.Instance
// Get a Game Module object
// Pass in either the name or Uid() of the object, and specify the type
GameModuleRepository.Instance.Get<Stat>(statName);
GameModuleRepository.Instance.Get<ItemObject>(gameItemObject.Uid());

// Get a List<> of the objects
GameModuleRepository.Instance.GetAll<ItemAttribute>();
GameModuleRepository.Instance.GetAll<LootItems>();

// Get a List<string> of all the ObjectTypes of a Game Module object type
GameModuleRepository.Instance.GetObjectTypes<ItemObject>();
GameModuleRepository.Instance.GetObjectTypes<ItemAttribute>();

// Get a List<> of the object of a specific ObjectType
var rarityAttributes = GameModuleRepository.Instance.GetByObjectType<ItemAttribute>("Rarity");

Last updated