Version: 2019.3
Variables API
Refactoring

Events API

Note
To use Bolt, which is Unity’s visual scripting solution, you must purchase it on the Unity Asset Store.

Bolt provides a simple API to trigger custom events from script.

Usings

Make sure you add the following usings to your C# script to access the API:

using Ludiq;
using Bolt;

Triggering

A single method call is needed to trigger a custom event:

CustomEvent.Trigger(targetGameObject, argument1, argument2, ...)

You can pass as many arguments as you need (or no event at all).

For example, this custom event unit:

Can be triggered with this line of code:

CustomEvent.Trigger(enemy, "Damage", 30);
Variables API
Refactoring
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961