EvolveByStatAbility.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{
// Check if an item (other) can be attached to target public void ExampleMethod(GDTKItem target, GDTKItem other) { EvolveByStatAbility action = target.GetPlugin<EvolveByStatAbility>(); SocketAbility socket = other.GetPlugin<SocketAbility>(); bool cancel = false;
if (action != null && socket != null) { action.AllowAction("attach", new object[] { socket }, ref cancel); } else { cancel = true; }
bool canAttach = !cancel; }
}