Skip to main content

PlayerCharacterStats.SubscribeToAttributeChange

Declaration#

public virtual void SubscribeToAttributeChange(SimpleEvent handler, string attributeId)

Parameters#

NameDescription
handlerHandler to invoke on change
attributeIdId of the attribute to subscribe to

Description#

Subscribe to Attribute changes

Usage#

Example
using NullSave.GDTK.Stats;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(PlayerCharacterStats source)    {        string id = source.database.attributes[0].info.id;        source.SubscribeToAttributeChange(AttributeChange, id);    }
    private void AttributeChange()    {        Debug.Log("Attribute has been added or removed.");    }
}