Skip to main content

HolsterAction.IsActionReady

Declaration#

public virtual bool IsActionReady(string actionKey)

Parameters#

NameDescription
actionKeyKey of the action

Description#

Get if a specific action is ready to perform

Usage#

using 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);    }
}