Skip to main content

GDTKItemStatSource.GetStatValue

Declaration#

public float GetStatValue(string id)

Parameters#

NameDescription
idId 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#

NameDescription
idId of the stat to get
inventoryInventory 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);    }
}