PlayerCharacterStats.SubscribeToAttributeChange
Declaration#
public virtual void SubscribeToAttributeChange(SimpleEvent handler, string attributeId)Parameters#
| Name | Description |
|---|---|
| handler | Handler to invoke on change |
| attributeId | Id 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."); }
}