Skip to main content

StatFunctions.SubHasClass

Declaration#

public static void SubHasClass(Dictionary<string, StatSource> sources, string request, SimpleEvent requester, List<SimpleEvent> subscriptionList)

Parameters#

NameDescription
sourcesDictionary of available Stat Sources
requestRequest to subscribe to
requesterCallback to call on subscription udates
subscriptionListList of subscriptions

Description#

Subscribe to has class

Usage#

Example
using NullSave.GDTK;using NullSave.GDTK.Stats;using System.Collections.Generic;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(StatSource source)    {        Dictionary<string, StatSource> sources = new Dictionary<string, StatSource>        {            { string.Empty, source },            { "global:", ToolRegistry.GetComponent<GlobalStats>().source }        };
        List<SimpleEvent> events = new List<SimpleEvent>();
        StatFunctions.SubHasClass(sources, "ranger", ValueChanged, events);    }
    private void ValueChanged()    {        Debug.Log("Request value has changed");    }
}