PlayerCharacterStats.AddAddOnPlugins
Declaration#
public virtual void AddAddOnPlugins(AddOnPlugin addOn, BasicInfo info, IUniquelyIdentifiable source, Action<List<ISelectableOption>> resultsCallback)Parameters#
| Name | Description |
|---|---|
| addOn | Plugin to add |
| info | Information about the plugin |
| source | Source associated with add-on |
| resultsCallback | Callback to invoke with results upon completion |
Description#
Adds one or more Add-On Plugin
Usage#
Example
using NullSave.GDTK;using NullSave.GDTK.Stats;using System;using System.Collections;using System.Collections.Generic;using UnityEngine;
public class Example : MonoBehaviour{
public IEnumerator ExampleMethod(PlayerCharacterStats source, GDTKLevelReward reward) { bool canContinue;
// Clone item to ensure we don't set database data GDTKLevelReward rewardClone = reward.Clone();
// Create a callback Action<List<ISelectableOption>> callback = l => { canContinue = true; };
// Add Add-Ons foreach (AddOnWrapper wrapper in rewardClone.addOnPlugins) { canContinue = false; source.AddAddOnPlugins(wrapper.plugin, null, callback); while (!canContinue) yield return new WaitForEndOfFrame(); } }
}