HolsterAction.IsActionReady
#
Declarationpublic virtual bool IsActionReady(string actionKey)
#
ParametersName | Description |
---|---|
actionKey | Key of the action |
#
DescriptionGet if a specific action is ready to perform
#
Usageusing NullSave.GDTK.Inventory;using System.Collections.Generic;using UnityEngine;
public class Example : MonoBehaviour{
// Check if an action is ready to run on an item public void ExampleMethod(GDTKItem target, string actionName) { // Get all ItemPlugins List<ItemPlugin> plugins = target.GetPlugins<ItemPlugin>();
// Check each plugin until a match is found foreach (ItemPlugin plugin in plugins) { if (plugin.IsActionReady(actionName)) { Debug.Log(actionName + " is ready to run on " + target.info.id); return; } }
Debug.Log(actionName + " is not ready to run on " + target.info.id); }
}