Get() Methods
v4.0
Get()
Get()Each list will have similar Get() methods. Dig into the Game[OBJECT]List.cs code to learn more.
The Get() methods have the additional addIfNull option. If true, the a new Game Module object will be created and returned, if it does not already exist.
TryGet()
TryGet()The TryGet() methods will return true or false if the item exists, and return the item to an out variable if it does. These methods will NOT add the Game Modules object to the list if it does not already exist.
GetByGameId() & TryGetByGameId()
GetByGameId() & TryGetByGameId()The runtime Game Module objects, such as GameStat, GameCondition, and GameItemObject, each have a unique GameId() which is created at runtime, and will stay the same even as the object is transferred.
This unique string identifies the specific instanace of the object in the game, opposed to the Uid() which is a unique string which identifies the Scriptable Object object, such as Stat, Condition, ItemObject.
In situations where a list may have multiple instances of a the same type of object, you may wish to Get() a specific instance, rather than obtaining the first found.
First() & Last()
First() & Last()While it's not difficult to get the first or last item in a list, we have helper methods for that as well.
GetAll()
GetAll()These will return an array of the type being handled. The array may be empty if there are none to return.
Additional Methods
Last updated
Was this helpful?