GDTKItemStatSource.GetStatValue
Declaration#
public float GetStatValue(string id)Parameters#
| Name | Description |
|---|---|
| id | Id of the stat to get |
Description#
Get the value of a stat
Usage#
using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(GDTKItemStatSource target, string other) { float result = target.GetStatValue(other); }
}Declaration#
public float GetStatValue(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 float result = target.GetStatValue(id, other); }
}