跳转到内容

图形组件

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

BakedLighting

How this scene is baked — atlas size, density, bounces — and a record of what the last bake read.

Explained in graphics/lighting.

FieldTypeDefaultNotes
atlasSizenumber1024Side of the square atlas, in texels. Range ≥ 64, step 64.
texelsPerUnitnumber0.25How finely a surface is lit. A world unit is a design pixel. Range ≥ 0.01, step 0.05.
bouncesnumber2How many times light may reflect. 0 = direct only. Range 0–8.
samplesnumber64Rays each lumel gathers per bounce. Range ≥ 1.
probeSamplesnumber128Directions each probe gathers, over the whole sphere. Range ≥ 1.
bakedFromstringemptyFingerprint of the inputs the last bake read.

BitmapText

Text drawn in world space from a bitmap font, sorted alongside sprites (UI text is `Text`).

Explained in graphics/sprites.

FieldTypeDefaultNotes
textstringempty
colorColor#ffffff
fontSizenumber1 Range ≥ 1.
alignenumLeft One of Left, Center, Right.
spacingnumber0
parallaxVec2(1, 1)Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).
layernumber0 Range step 1.
fontAsset<font>none
enabledbooleantrue

Camera

A view onto the world — projection, zoom, viewport rect, clear flags and render priority.

Explained in graphics/camera.

FieldTypeDefaultNotes
projectionTypeenumOrthographicOrthographic (2D) or Perspective projection. One of Perspective, Orthographic.
fovnumber60 Range 1–179.
orthoSizenumber540Half the visible height in world units (Orthographic). Range ≥ 0.
nearPlanenumber0.1 Range ≥ 0.
farPlanenumber1000 Range ≥ 0.
aspectRationumber1.77
isActivebooleantrue
prioritynumber0 Range step 1.
viewportVec4(0, 0, 1, 1)
clearFlagsnumber3Which buffers to clear before rendering this camera.
pixelPerfectbooleanfalseSnap the camera to the pixel grid for crisp pixel-art (Orthographic).
cullingMasknumber4294967295Which sorting layers this camera renders.
renderTargetnumber0Render into a RenderTexture instead of the screen (0 = screen). Set at run time.
showFrustumbooleanfalseDraw this camera's whole view volume in the editor, not just what it frames on the content plane.

CameraBounds

The world rectangle a camera may not look outside of, so the level edge stays at the screen edge.

Explained in graphics/camera.

FieldTypeDefaultNotes
minXnumber0
minYnumber0
maxXnumber0
maxYnumber0

Canvas

The design resolution and scale mode a scene is authored against — one per scene root.

Explained in core-concepts/screen.

FieldTypeDefaultNotes
designResolutionVec2(1920, 1080)
pixelsPerUnitnumber100World pixels per physics meter (Box2D + tile collider scale). Range ≥ 1.
scaleModeenumFixedHeightHow the canvas adapts the design resolution to the screen. One of FixedWidth, FixedHeight, Expand, Shrink, Match.
matchWidthOrHeightnumber0.50 matches width, 1 matches height (Match mode only). Range 0–1.
backgroundColorColor#000000
layerenum (sortingLayers)0Sorting layer this UI belongs to — cameras cull by it. Range step 1.

DecalProjector

Prints this entity's material onto what its box covers — the surface is cut to the box and drawn again, so a decal is lit and shadowed as the surface under it.

Explained in graphics/lighting.

FieldTypeDefaultNotes
facingnumber0.2How squarely a surface must face the projector to take the decal. Range -1–1, step 0.05.
bakedFromstringemptyWhat the last cut read.

FollowTarget

Makes a camera chase an entity, with an offset, a dead zone and eased catch-up.

Explained in graphics/camera.

FieldTypeDefaultNotes
targetnumber-1
offsetXnumber0
offsetYnumber0
offsetZnumber0
followZbooleanfalse
deadzonenumber0
dampingnumber0.25

Light

A light — point, directional, spot or ambient — read by lit renderers, Lit materials and mesh shadow maps.

Explained in graphics/lighting.

FieldTypeDefaultNotes
typeenumPointPoint, Directional, Ambient, or Spot. One of Point, Directional, Ambient, Spot.
colorColor#ffffff
intensitynumber1Brightness multiplier of the light. Range ≥ 0.
radiusnumber200Falloff reach in world units (Point / Spot). Range ≥ 0.
innerRadiusnumber0Radius held at full strength before the falloff starts. Range ≥ 0.
falloffnumber1Falloff shape: 1 = linear, higher pools near the light, lower reaches further. Range 0–8.
shadowStrengthnumber1How much of this light its shadows remove (1 = all of it). Range 0–1.
cookieAsset<texture>noneA texture whose alpha shapes this light (a cookie).
cookieSizeVec2(0, 0)Cookie size in world units; 0 = the light's own reach. Range ≥ 0.
innerAnglenumber30 Range 0–180.
outerAnglenumber45 Range 0–180.
shadowSoftnessnumber0Shadow softness (light-source size); 0 = hard edge. Range ≥ 0.
sourceAnglenumber0.53Angular size of a Directional light's source (the sun is 0.53); 0 = hard edge. Range 0–90.
shadowDistancenumber0Directional shadow distance; 0 = no directional shadow. Range ≥ 0.
meshShadowsbooleanfalseCast a shadow map over 3D meshes (Directional, Spot, Point).
shadowExtentnumber0Shadow map coverage radius; 0 = fit the view. Range ≥ 0.
followEnvironmentSunbooleanfalseTake direction and strength from the environment's sun, and light the sky without it.
environmentAsset<environment>noneBaked environment (.esenv) this Ambient light casts.
environmentRotationnumber0Turn the environment about the up axis, in degrees.
drawEnvironmentbooleanfalseDraw this environment as the sky behind the scene.
enabledbooleantrue

LightProbeVolume

A box of baked irradiance on a grid — what lights the things a lightmap cannot hold still, characters included.

Explained in graphics/lighting.

FieldTypeDefaultNotes
probesAsset<probeVolume>noneBaked probe grid (.esprobes) filling this box.
halfExtentsVec3(100, 100, 100)Half the box this volume covers, from the entity's position. Range ≥ 0.
spacingnumber100World units between probes the next bake lays down. Range ≥ 1.
enabledbooleantrue

LODGroup

Cheaper stand-in meshes for a MeshRenderer, chosen by how much of the screen the object covers.

Explained in performance/level-of-detail.

FieldTypeDefaultNotes
lod1Asset<mesh>noneGeometry drawn below the LOD 1 screen size.
lod2Asset<mesh>noneGeometry drawn below the LOD 2 screen size.
lod3Asset<mesh>noneGeometry drawn below the LOD 3 screen size.
lod1Sizenumber0.5Screen height fraction below which LOD 1 takes over. Range 0–1.
lod2Sizenumber0.25Screen height fraction below which LOD 2 takes over. Range 0–1.
lod3Sizenumber0.1Screen height fraction below which LOD 3 takes over. Range 0–1.
cullSizenumber0.02Screen height fraction below which nothing is drawn (0 = never). Range 0–1.
hysteresisnumber0.1Extra fraction to grow past a threshold before the finer level returns. Range 0–1.
enabledbooleantrueOff: the MeshRenderer's own mesh is always drawn.

MeshLightmap

Where a MeshRenderer's baked light comes from — the atlas, and the rectangle of it this object occupies.

Explained in graphics/lighting.

FieldTypeDefaultNotes
lightmapAsset<texture>noneBaked lightmap atlas. Needs a mesh with a second UV set.
scaleOffsetVec4(1, 1, 0, 0)Atlas rectangle: xy scales the second UV set, zw offsets it.

MeshMorph

How far a MeshRenderer is blended towards each of the shapes its mesh carries — one weight per morph target.

Explained in assets/models.

FieldTypeDefaultNotes
weightsarrayemptyWeight per morph target of the mesh, in the order the mesh carries them.

MeshRenderer

Geometry drawn as an entity — your own vertices or an imported mesh, with a material and a sorting layer.

Explained in graphics/drawing.

FieldTypeDefaultNotes
textureAsset<texture>none
normalMapAsset<texture>noneNormal map (tangent space). Needs a mesh with normals.
colorColor#ffffffTint multiplied into the vertex colors (white = unchanged).
layerenum (sortingLayers)0Sorting layer — controls draw order across renderables. Range step 1.
opaquebooleanfalseOpaque: no blending; writes and tests depth, so meshes occlude each other.
cullBackfacesbooleanfalseCull back faces: triangles facing away from the camera are skipped.
litbooleanfalseReceive 2D lights: Light entities light this mesh (flat normal). A custom material overrides this.
parallaxVec2(1, 1)Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).
materialAsset<material>none
enabledbooleantrue
meshAsset<mesh>none
geometryobject{"positions":[],"indices":[]}

MeshSkin

The joint entities that deform a MeshRenderer — an imported skin, in the order its bind matrices are in.

Explained in assets/models.

FieldTypeDefaultNotes
jointsEntityJoint entities, in the order the mesh's bind matrices are in.

Occluder

A box sight does not pass through — what stands behind it is not collected, and the picture is unchanged.

Explained in performance/occlusion-culling.

FieldTypeDefaultNotes
halfExtentsVec3(50, 50, 50)Half the solid box, in world units, from the entity's position. Range ≥ 0.
enabledbooleantrueOff: this box hides nothing.

PostProcessVolume

A stack of full-screen effects (bloom, vignette, colour grading) applied after the scene is drawn.

Explained in graphics/post-processing.

FieldTypeDefaultNotes
effectsarrayempty
isGlobalbooleantrue
shapestring"box"
sizeVec2(5, 5)
prioritynumber0
weightnumber1
blendDistancenumber0

ReflectionProbe

A box inside which reflections come from a bake rather than from the sky — the specular half of what a light probe volume answers.

Explained in graphics/lighting.

FieldTypeDefaultNotes
reflectionAsset<environment>noneThe scene's baked reflections (the baker writes this).
halfExtentsVec3(200, 200, 200)Half the box this probe answers inside, from the entity's position. Range ≥ 0.
slotnumber0Which column of the atlas this probe occupies (the baker writes this). Range ≥ 0.
enabledbooleantrueOff: what stands inside this box reflects the sky again.

ShadowCaster2D

Marks a renderer as an occluder, so 2D lights cast shadows from its silhouette.

Explained in graphics/lighting.

FieldTypeDefaultNotes
sizeVec2(32, 32)Occluder box size in world units (centred on the entity, turning with it). Unused when the caster has an outline. Range ≥ 0.
patharrayempty
enabledbooleantrue

ShapeRenderer

A filled or stroked primitive — rectangle, circle, capsule — with no texture asset.

Explained in graphics/sprites.

FieldTypeDefaultNotes
shapeTypeenumCircle One of Circle, Capsule, RoundedRect.
colorColor#ffffff
sizeVec2(100, 100)
cornerRadiusnumber0 Range ≥ 0.
layerenum (sortingLayers)0 Range step 1.
parallaxVec2(1, 1)Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).
enabledbooleantrue

SortingGroup

Makes an entity and its whole subtree sort as one unit — the group states the layer and order, members state their place inside it.

Explained in graphics/sprites.

FieldTypeDefaultNotes
layerenum (sortingLayers)0Sorting layer for the entire group — members no longer state their own. Range step 1.
ordernumber0Draw order of the whole group inside its sorting layer — higher draws on top. Range -128–127, step 1.
enabledbooleantrue

Sprite

Draws a texture in the world — tint, size, pivot, sorting layer, flipping, tiling and parallax.

Explained in graphics/sprites.

FieldTypeDefaultNotes
textureAsset<texture>none
colorColor#ffffffTint multiplied into the texture (white = unchanged).
sizeVec2(100, 100)
pivotVec2(0.5, 0.5)Anchor point the sprite rotates and scales about, as a fraction of its size (0.5,0.5 = centre). Values outside 0–1 sit off the sprite.
uvOffsetVec2(0, 0)
uvScaleVec2(1, 1)
layerenum (sortingLayers)0Sorting layer — controls draw order across sprites. Range step 1.
ordernumber0Draw order inside the sorting layer — higher draws on top. Overrides the layer's Y-sort or depth ordering; leave 0 to keep it. Range -128–127, step 1.
maskInteractionenumNoneWhether a SpriteMask drawn before this sprite clips it, and which side survives. One of None, VisibleInside, VisibleOutside.
litbooleanfalseReceive 2D lights: Light entities light this sprite (flat normal). A custom material overrides this.
flipXbooleanfalse
flipYbooleanfalse
drawModeenumAutoDraw mode: Auto infers from tile size and the texture's 9-slice border; the others override it. One of Auto, Simple, Tiled, NineSlice.
tileSizeVec2(0, 0)
tileSpacingVec2(0, 0)
parallaxVec2(1, 1)Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).
materialAsset<material>none
enabledbooleantrue

SpriteMask

Turns this entity's Sprite into a stencil that cuts the sprites drawn after it — a window, or a hole.

Explained in graphics/sprites.

FieldTypeDefaultNotes
alphaCutoffnumber0Cut to the sprite's shape instead of its box: fragments below this alpha do not mask. Range 0–1.
limitRangebooleanfalseLimit how far this mask reaches; off = every sprite drawn after it.
rangeEndLayerenum (sortingLayers)0Last sorting layer this mask reaches. Range step 1.
rangeEndOrdernumber0Last order inside that layer this mask reaches, inclusive. Range -128–127, step 1.
enabledbooleantrue

TrailRenderer

A ribbon trailing the entity as it moves, tapering and fading over its lifetime.

Explained in graphics/sprites.

FieldTypeDefaultNotes
timenumber0.5Seconds each trail point lives before it fades out of the tail. Range ≥ 0.
minVertexDistancenumber5Min world distance moved before a new trail point is recorded. Range ≥ 0.
emittingbooleantrueRecord new points. False = freeze and let the streak fade in place.
startWidthnumber20Full ribbon width at the head (newest point). Range ≥ 0.
endWidthnumber0Full ribbon width at the tail (oldest point). Range ≥ 0.
startColorColor#ffffffColor at the head (newest point).
endColorColor#ffffff00Color at the tail (oldest point) — usually alpha 0 to fade out.
textureAsset<texture>none
blendModenumber0Blend mode: 0 Normal, 1 Additive (glow), 2 Multiply, …
layerenum (sortingLayers)0Sorting layer — controls draw order across renderables. Range step 1.
materialAsset<material>none
enabledbooleantrue

Video

Plays a video stream onto a surface in the world or the UI.

Explained in graphics/video.

FieldTypeDefaultNotes
sourceAsset<video>none
autoplaybooleantrue
loopbooleantrue
mutedbooleantrue
volumenumber1
playbackRatenumber1
fitSizebooleantrue
enabledbooleantrue