ScriptSignal

Overview

ScriptSignal is an event system that detects a specific condition in game and automatically executes the functions connected to that signal.

When the signal is triggered, the connected user-defined functions are called. If necessary, information associated with the event is passed as parameters to support more flexible implementation of various interactions.

Constructors

Properties

Methods

Connect

Registers a function to be called when the event occurs and returns a ScriptConnection object that manages the connection state.

After registration, the specified function is automatically executed whenever the event is triggered, and the returned connection object can be used to disconnect from the event at any time.

Parameters

function func

Specifies the user-defined function to connect to the event signal.

Return

ScriptConnection

A ScriptConnection object that can be used to manage signal connection.

Code Samples

Once

Registers a function to be executed only once when the event occurs and returns a ScriptConnection object that manages the connection state.

Unlike Connect, the connection is automatically disconnected just before the first event is delivered, which is suitable for processing a single call without requiring separate disconnection.

Parameters

function func

Specifies the user-defined function to connect to the event signal.

Return

ScriptConnection

A ScriptConnection object that can be used to manage signal connection.

Code Samples

Last updated