ItemPlugin.AllowAction
Declaration#
public virtual void AllowAction(string action, Object[] args, Boolean& cancel)Parameters#
| Name | Description |
|---|---|
| action | Command to run |
| args | Parameters |
| cancel | Cancel action indicator |
Description#
Check if an action is allowed
Usage#
using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(GDTKItem target) { ItemPlugin plugin = target.GetPlugin<ItemPlugin>(); if(plugin != null ) { bool cancel = false; plugin.AllowAction("actionName", new object[] { "parameter1", 2 }, ref cancel);
// If cancel is now true the action is not allowed } }
}