Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

chore(api): a game can configure the hunter it places

esengine9fa995b4e294
diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.md
index d9e5f2b17..4da6387a5 100644
--- a/sdk/etc/index.api.md
+++ b/sdk/etc/index.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 84 beta · 1596 experimental · 3 deprecated
+Symbols: 113 public · 84 beta · 1603 experimental · 3 deprecated
## ABI_LAYOUT_HASH — const @experimental
```
@@ -3900,6 +3900,35 @@ static new (options: HttpBackendOptions): HttpBackend
static prototype: HttpBackend
```
+## Hunter — const @experimental
+```
+ComponentDef<HunterData>
+```
+
+## HunterData — interface @experimental
+```
+attackInterval: number
+attackRange: number
+cooldown: number
+enabled: boolean
+idleThreshold: number
+rotationSpeed: number
+state: string
+```
+
+## HunterSituation — interface @experimental
+```
+alive: boolean
+attackRange: number
+distance: number
+visible: boolean
+```
+
+## HunterState — type @experimental
+```
+'idle' | 'chase' | 'attack' | 'dead'
+```
+
## INTERACTION_CONTROLLER — const @experimental
```
"$interaction"
@@ -10755,6 +10784,11 @@ Plugin
(category: string, message: string, data?: unknown): void
```
+## decideHunterState — function @experimental
+```
+(s: HunterSituation): HunterState
+```
+
## decodeImageBitmap — function @experimental
```
(src: ImageBitmapSource | PlatformImage, flip: boolean): Promise<ImageBitmap>
@@ -10885,6 +10919,11 @@ DragPlugin
(app: App, contacts?: readonly Contact3D[]): void
```
+## driveHunterRootMotion — function @experimental
+```
+(world: World): void
+```
+
## editorViewAxes — function @experimental
```
(view: EditorViewData): { x: ScreenAxis; y: ScreenAxis; z: ScreenAxis; }
@@ -11435,6 +11474,11 @@ GameplayPlugin
() => Plugin[]
```
+## huntTargets — function @experimental
+```
+(world: World, animator: AnimatorControllerAPI | null, attackTrigger: string, dt: number): void
+```
+
## imageBitmapOptions — function @experimental
```
(flip: boolean): ImageBitmapOptions
diff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.md
index 7c3294e69..71d8c3445 100644
--- a/sdk/etc/index.native.api.md
+++ b/sdk/etc/index.native.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.native
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 89 beta · 1615 experimental · 3 deprecated
+Symbols: 113 public · 89 beta · 1622 experimental · 3 deprecated
## ABI_LAYOUT_HASH — const @experimental
```
@@ -3908,6 +3908,35 @@ static new (options: HttpBackendOptions): HttpBackend
static prototype: HttpBackend
```
+## Hunter — const @experimental
+```
+ComponentDef<HunterData>
+```
+
+## HunterData — interface @experimental
+```
+attackInterval: number
+attackRange: number
+cooldown: number
+enabled: boolean
+idleThreshold: number
+rotationSpeed: number
+state: string
+```
+
+## HunterSituation — interface @experimental
+```
+alive: boolean
+attackRange: number
+distance: number
+visible: boolean
+```
+
+## HunterState — type @experimental
+```
+'idle' | 'chase' | 'attack' | 'dead'
+```
+
## INTERACTION_CONTROLLER — const @experimental
```
"$interaction"
@@ -10988,6 +11017,11 @@ Plugin
(category: string, message: string, data?: unknown): void
```
+## decideHunterState — function @experimental
+```
+(s: HunterSituation): HunterState
+```
+
## decodeImageBitmap — function @experimental
```
(src: ImageBitmapSource | PlatformImage, flip: boolean): Promise<ImageBitmap>
@@ -11118,6 +11152,11 @@ DragPlugin
(app: App, contacts?: readonly Contact3D[]): void
```
+## driveHunterRootMotion — function @experimental
+```
+(world: World): void
+```
+
## editorViewAxes — function @experimental
```
(view: EditorViewData): { x: ScreenAxis; y: ScreenAxis; z: ScreenAxis; }
@@ -11668,6 +11707,11 @@ GameplayPlugin
() => Plugin[]
```
+## huntTargets — function @experimental
+```
+(world: World, animator: AnimatorControllerAPI | null, attackTrigger: string, dt: number): void
+```
+
## imageBitmapOptions — function @experimental
```
(flip: boolean): ImageBitmapOptions
diff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.md
index c2b8edc90..b66e14180 100644
--- a/sdk/etc/index.node.api.md
+++ b/sdk/etc/index.node.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.node
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 86 beta · 1595 experimental · 3 deprecated
+Symbols: 113 public · 86 beta · 1602 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -3895,6 +3895,35 @@ static new (options: HttpBackendOptions): HttpBackend
static prototype: HttpBackend
```
+## Hunter — const @experimental
+```
+ComponentDef<HunterData>
+```
+
+## HunterData — interface @experimental
+```
+attackInterval: number
+attackRange: number
+cooldown: number
+enabled: boolean
+idleThreshold: number
+rotationSpeed: number
+state: string
+```
+
+## HunterSituation — interface @experimental
+```
+alive: boolean
+attackRange: number
+distance: number
+visible: boolean
+```
+
+## HunterState — type @experimental
+```
+'idle' | 'chase' | 'attack' | 'dead'
+```
+
## INTERACTION_CONTROLLER — const @experimental
```
"$interaction"
@@ -10750,6 +10779,11 @@ Plugin
(category: string, message: string, data?: unknown): void
```
+## decideHunterState — function @experimental
+```
+(s: HunterSituation): HunterState
+```
+
## decodeImageBitmap — function @experimental
```
(src: ImageBitmapSource | PlatformImage, flip: boolean): Promise<ImageBitmap>
@@ -10880,6 +10914,11 @@ DragPlugin
(app: App, contacts?: readonly Contact3D[]): void
```
+## driveHunterRootMotion — function @experimental
+```
+(world: World): void
+```
+
## editorViewAxes — function @experimental
```
(view: EditorViewData): { x: ScreenAxis; y: ScreenAxis; z: ScreenAxis; }
@@ -11430,6 +11469,11 @@ GameplayPlugin
() => Plugin[]
```
+## huntTargets — function @experimental
+```
+(world: World, animator: AnimatorControllerAPI | null, attackTrigger: string, dt: number): void
+```
+
## imageBitmapOptions — function @experimental
```
(flip: boolean): ImageBitmapOptions
diff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.md
index 434d6fa76..040a47f25 100644
--- a/sdk/etc/minigame.api.md
+++ b/sdk/etc/minigame.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/minigame
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 84 beta · 1617 experimental · 3 deprecated
+Symbols: 113 public · 84 beta · 1624 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -3895,6 +3895,35 @@ static new (options: HttpBackendOptions): HttpBackend
static prototype: HttpBackend
```
+## Hunter — const @experimental
+```
+ComponentDef<HunterData>
+```
+
+## HunterData — interface @experimental
+```
+attackInterval: number
+attackRange: number
+cooldown: number
+enabled: boolean
+idleThreshold: number
+rotationSpeed: number
+state: string
+```
+
+## HunterSituation — interface @experimental
+```
+alive: boolean
+attackRange: number
+distance: number
+visible: boolean
+```
+
+## HunterState — type @experimental
+```
+'idle' | 'chase' | 'attack' | 'dead'
+```
+
## INTERACTION_CONTROLLER — const @experimental
```
"$interaction"
@@ -11007,6 +11036,11 @@ Plugin
(category: string, message: string, data?: unknown): void
```
+## decideHunterState — function @experimental
+```
+(s: HunterSituation): HunterState
+```
+
## decodeImageBitmap — function @experimental
```
(src: ImageBitmapSource | PlatformImage, flip: boolean): Promise<ImageBitmap>
@@ -11137,6 +11171,11 @@ DragPlugin
(app: App, contacts?: readonly Contact3D[]): void
```
+## driveHunterRootMotion — function @experimental
+```
+(world: World): void
+```
+
## editorViewAxes — function @experimental
```
(view: EditorViewData): { x: ScreenAxis; y: ScreenAxis; z: ScreenAxis; }
@@ -11687,6 +11726,11 @@ GameplayPlugin
() => Plugin[]
```
+## huntTargets — function @experimental
+```
+(world: World, animator: AnimatorControllerAPI | null, attackTrigger: string, dt: number): void
+```
+
## imageBitmapOptions — function @experimental
```
(flip: boolean): ImageBitmapOptions
diff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.md
index 032af972c..6e4f8c644 100644
--- a/sdk/etc/wechat.api.md
+++ b/sdk/etc/wechat.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/wechat
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 113 public · 84 beta · 1607 experimental · 3 deprecated
+Symbols: 113 public · 84 beta · 1614 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -3895,6 +3895,35 @@ static new (options: HttpBackendOptions): HttpBackend
static prototype: HttpBackend
```
+## Hunter — const @experimental
+```
+ComponentDef<HunterData>
+```
+
+## HunterData — interface @experimental
+```
+attackInterval: number
+attackRange: number
+cooldown: number
+enabled: boolean
+idleThreshold: number
+rotationSpeed: number
+state: string
+```
+
+## HunterSituation — interface @experimental
+```
+alive: boolean
+attackRange: number
+distance: number
+visible: boolean
+```
+
+## HunterState — type @experimental
+```
+'idle' | 'chase' | 'attack' | 'dead'
+```
+
## INTERACTION_CONTROLLER — const @experimental
```
"$interaction"
@@ -10778,6 +10807,11 @@ Plugin
(category: string, message: string, data?: unknown): void
```
+## decideHunterState — function @experimental
+```
+(s: HunterSituation): HunterState
+```
+
## decodeImageBitmap — function @experimental
```
(src: ImageBitmapSource | PlatformImage, flip: boolean): Promise<ImageBitmap>
@@ -10908,6 +10942,11 @@ DragPlugin
(app: App, contacts?: readonly Contact3D[]): void
```
+## driveHunterRootMotion — function @experimental
+```
+(world: World): void
+```
+
## editorViewAxes — function @experimental
```
(view: EditorViewData): { x: ScreenAxis; y: ScreenAxis; z: ScreenAxis; }
@@ -11458,6 +11497,11 @@ GameplayPlugin
() => Plugin[]
```
+## huntTargets — function @experimental
+```
+(world: World, animator: AnimatorControllerAPI | null, attackTrigger: string, dt: number): void
+```
+
## imageBitmapOptions — function @experimental
```
(flip: boolean): ImageBitmapOptions
diff --git a/sdk/src/core-content.ts b/sdk/src/core-content.ts
index ae78f17e5..2e3f0cfea 100644
--- a/sdk/src/core-content.ts
+++ b/sdk/src/core-content.ts
@@ -894,6 +894,13 @@ export {
WORLD_BASIS,
DODGE_KEY,
ATTACK_KEY,
+ Hunter,
+ decideHunterState,
+ huntTargets,
+ driveHunterRootMotion,
+ type HunterData,
+ type HunterState,
+ type HunterSituation,
Health,
Damage,
applyDamage,