GFProjectileBurstPattern2D¶
API Reference / Combat / 类索引
- 路径:
addons/gf/extensions/combat/projectiles/gf_projectile_burst_pattern_2d.gd - 模块:
Combat - 继承:
GFProjectileSpawnPattern2D - API:
public - 类别:资源定义 (
resource_definition) - 首次版本:
3.17.0
2D 扇形/环形发射点模式。 通过数量、角度和半径生成一组通用发射变换,适合散射、圆环、扇形或单点发射。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 属性 | projectile_count |
var projectile_count: int = 1 |
| 属性 | spread_degrees |
var spread_degrees: float = 0.0 |
| 属性 | center_angle_degrees |
var center_angle_degrees: float = 0.0 |
| 属性 | radius |
var radius: float = 0.0 |
| 属性 | rotate_to_direction |
var rotate_to_direction: bool = true |
| 属性 | include_emitter_rotation |
var include_emitter_rotation: bool = true |
| 方法 | _get_spawn_transforms |
func _get_spawn_transforms( emitter: Node2D, _projectile_context: Dictionary = {}, emit_count: int = -1 ) -> Array[Transform2D]: |
属性¶
projectile_count¶
- API:
public
默认发射数量。
spread_degrees¶
- API:
public
总扩散角度(度)。数量大于 1 时在该范围内均匀分布。
center_angle_degrees¶
- API:
public
相对发射器朝向的中心角度(度)。
radius¶
- API:
public
生成点距离发射器的半径。
rotate_to_direction¶
- API:
public
生成变换是否朝向对应发射方向。
include_emitter_rotation¶
- API:
public
是否把发射器自身旋转计入方向。
方法¶
_get_spawn_transforms¶
- API:
protected
func _get_spawn_transforms( emitter: Node2D, _projectile_context: Dictionary = {}, emit_count: int = -1 ) -> Array[Transform2D]:
生成 2D 扇形或环形发射变换。
参数:
| 名称 | 说明 |
|---|---|
emitter |
发射器节点。 |
_projectile_context |
本次发射上下文。 |
emit_count |
调用方请求的数量;小于等于 0 时使用 projectile_count。 |
返回:全局 Transform2D 列表。
结构:
_projectile_context: Dictionary,本次发射上下文;当前实现不读取该字典。