Skip to main content

BasicStats.AddAttribute

Declaration#

public GDTKAttribute AddAttribute(string id, IUniquelyIdentifiable source)

Parameters#

NameDescription
idId of the attribute to add
sourceObject adding this Attribute

Description#

Add an Attribute to the object.

Usage#

Example
using NullSave.GDTK;using NullSave.GDTK.Stats;using UnityEngine;
public class Example : MonoBehaviour, IUniquelyIdentifiable{
    // Implment the IUniquelyIdentifiable interface to call RemoveXBySource    public string instanceId    {        get { return "exampleInstance"; }    }
    public void ExampleMethod(BasicStats source)    {        source.AddAttribute(source.database.attributes[0].info.id, this);    }
}