跳转到内容

玩法组件

下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 Details 面板读的那一份—— 所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲怎么用的正文在 每条目所链接的指南里。字段说明取自 C++ ES_PROPERTY 处的原文,因此为英文。

AudioListener

The ear spatial audio is mixed relative to — usually the camera or the player.

Explained in assets/audio.

FieldTypeDefaultNotes
enabledbooleantrue

AudioSource

Declarative playback attached to an entity, attenuated by distance when spatial.

Explained in assets/audio.

FieldTypeDefaultNotes
clipAsset<audio>none
busstring"sfx"
volumenumber1
pitchnumber1
loopbooleanfalse
playingbooleanfalseRaise to play, lower to stop. The engine lowers it when a non-looping clip ends.
finishedbooleanfalseClip completed (runtime, read-only). Raise Playing to play it again.
playOnAwakebooleanfalse
spatialbooleanfalse
minDistancenumber100
maxDistancenumber1000
attenuationModelnumber1
rolloffnumber1
prioritynumber0
enabledbooleantrue

BehaviorTreeAgent

Ticks a behavior tree asset against a blackboard, calling registry actions at its leaves.

Explained in gameplay/ai/behavior-trees.

FieldTypeDefaultNotes
btAsset<behaviortree>none
statusstringemptyLast root status (runtime, read-only).

EventBinding

Wires an event on this entity to named actions — gameplay authored in the inspector, with no script.

Explained in scripting/events.

FieldTypeDefaultNotes
rowsarrayempty

Steers an entity along a path found on the navigation grid.

Explained in gameplay/ai/navigation.

FieldTypeDefaultNotes
speednumber120 Range ≥ 0.
radiusnumber0 Range ≥ 0.
arriveRadiusnumber6 Range ≥ 0.
repathIntervalnumber0.5Replan cadence while moving; 0 = only when the target changes. Range ≥ 0.
hasTargetbooleanfalse
targetXnumber0
targetYnumber0
targetZnumber0
arrivedbooleanfalse

A box of ground that costs more or less to cross — mud, water, a road.

Explained in gameplay/ai/navigation.

FieldTypeDefaultNotes
halfExtentsVec3(200, 100, 200)
costnumber3What crossing it costs against 1 for open ground. Range ≥ 0.
enabledbooleantrue

A way between two places the ground does not join — a drop, a ladder, a plank.

Explained in gameplay/ai/navigation.

FieldTypeDefaultNotes
startVec3(0, 0, 0)
endVec3(0, 0, 150)
bidirectionalbooleantrueWhether it can be taken both ways — a drop off a ledge cannot.
radiusnumber50How far from each end ground may be and still be joined. Range ≥ 1.
enabledbooleantrue

A box that blocks without being geometry — a door, a gate, a placed building.

Explained in gameplay/ai/navigation.

FieldTypeDefaultNotes
halfExtentsVec3(50, 100, 50)
enabledbooleantrueWhether it blocks right now — a door that opens.

The box a navigation mesh is baked over, out of the scene’s own collision geometry.

Explained in gameplay/ai/navigation.

FieldTypeDefaultNotes
halfExtentsVec3(1000, 500, 1000)
cellSizenumber50 Range ≥ 1.
cellHeightnumber10Vertical voxel size; what separates one level from the one above it. Range ≥ 1.
maxSlopeDegreesnumber45 Range 0–89.
agentHeightnumber180Headroom an agent needs to walk somewhere. Range ≥ 0.
agentRadiusnumber30How wide the agent is; the mesh is pulled back from walls by this. Range ≥ 0.
stepHeightnumber40 Range ≥ 0.
layersnumber0Layer mask the ground is taken from; 0 = every layer. Range ≥ 0.

NetGhost

Tag: this entity is a client-side proxy of one the server owns.

Explained in scripting/networking.

A tag — it carries no fields.

Perceiver

Senses nearby perception targets within a sight cone and range.

Explained in gameplay/ai/perception.

FieldTypeDefaultNotes
rangenumber220 Range ≥ 0.
fovDegreesnumber360 Range 0–360.
facingAxisstring"x"'x' is screen-right (a flat scene); '-z' is where an imported model faces.
losLayersnumber03D layer mask the sight ray may hit; 0 = every layer. Range ≥ 0.

Perceptiontransient

What a perceiver currently sees — written each frame for the entity's own logic to read.

Explained in gameplay/ai/perception.

FieldTypeDefaultNotes
visiblebooleanfalseA target is seen (runtime, read-only).
distancenumber0
targetXnumber0
targetYnumber0
targetZnumber0
dirXnumber0
dirYnumber0
dirZnumber0

PerceptionTarget

Tag: perceivers can see this entity.

Explained in gameplay/ai/perception.

A tag — it carries no fields.

Replicated

Marks an entity the server replicates to every client.

Explained in scripting/networking.

FieldTypeDefaultNotes
netIdnumber0
ownernumber0
archetypestringempty

ScriptGraphAgent

Runs a script graph asset on this entity — events, an exec wire, and data wires between registered names.

No guide section covers this one yet.

FieldTypeDefaultNotes
graphAsset<scriptgraph>none

StateMachineAgent

Runs a gameplay state machine asset, calling registry actions as states enter, update and exit.

Explained in gameplay/ai/state-machines.

FieldTypeDefaultNotes
fsmAsset<statemachine>none
currentstringemptyActive state (runtime, read-only).