GDTKItemStatSource.GetStat
Declaration#
public GDTKStatProxy GetStat(string id)Parameters#
| Name | Description |
|---|---|
| id | Id of the stat to get |
Description#
Get a stat by id
Usage#
using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(GDTKItemStatSource target, string other) { // This can be either a GDTKItemStat (default) // Or Stats.GDTKStat if GDTK: Stats installed and advanced stats enabled var stat = target.GetStat(other); }
}Declaration#
public GDTKStatProxy GetStat(string id, Inventory inventory)Parameters#
| Name | Description |
|---|---|
| id | Id of the stat to get |
| inventory | Inventory requesting value |
Description#
Get a stat by id
Usage#
Example
using NullSave.GDTK.Inventory;using UnityEngine;
public class CodeSample : MonoBehaviour{
public void Example(GDTKItemStatSource target, Inventory other, string id) { // Stats can be initialized on an item per inventory // This is because players may have different contributing stats that affect the results GDTKStatProxy result = target.GetStat(id, other); }
}