From 78c7a8f4dd29b54f05d6b43ff53893e76154ac47 Mon Sep 17 00:00:00 2001 From: lajbel Date: Mon, 20 Jan 2025 17:25:26 -0300 Subject: [PATCH] fix: area events return type --- src/components/physics/area.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/physics/area.ts b/src/components/physics/area.ts index a81052eb..dc646c77 100644 --- a/src/components/physics/area.ts +++ b/src/components/physics/area.ts @@ -131,13 +131,16 @@ export interface AreaComp extends Comp { * * @since v2001.0 */ - onCollide(tag: Tag, f: (obj: GameObj, col?: Collision) => void): void; + onCollide( + tag: Tag, + f: (obj: GameObj, col?: Collision) => void, + ): KEventController; /** * Register an event runs once when collide with another game obj. * * @since v2000.1 */ - onCollide(f: (obj: GameObj, col?: Collision) => void): void; + onCollide(f: (obj: GameObj, col?: Collision) => void): KEventController; /** * Register an event runs every frame when collide with another game obj with certain tag. * @@ -145,7 +148,7 @@ export interface AreaComp extends Comp { */ onCollideUpdate( tag: Tag, - f: (obj: GameObj, col?: Collision) => void, + f: (obj: GameObj, col?: Collision) => KEventController, ): KEventController; /** * Register an event runs every frame when collide with another game obj.