Skip to content

SimpleAreaShadowLight ​

概览 ​

字段值
KindUnit · 单位 Unit
Realmcommon

继承关系 ​

  • Unit(4 属性 / 25 函数 / 6 事件)
    • SimpleLight(6 属性)
      • [SimpleAreaShadowLight](3 属性)

继承成员 ​

2 个来源 / 10 属性 / 25 函数 / 6 事件

SimpleAreaShadowLight 是暗调矩形自发光体,用较深颜色呈现面状装饰光效,不会向周围物体投射真实照明。

适用场景 ​

用于夜景面板、洞穴标记或暗色界面装饰等低亮度矩形自发光外观。

使用要点 ​

通过 World:CreateUnit("SimpleAreaShadowLight", config) 创建实例,用 Color 和 Size 调整暗调自发光面的颜色与尺寸。

注意事项 ​

SimpleAreaShadowLight 创建后需要绑定到引擎支持的光照挂载结构并处于可渲染场景中才可能生效;单独 World:CreateUnit 或简单挂到 LightingService/WorldUnit 不一定产生视觉表现。当前表现依赖渲染管线版本,请在目标端实测。

代码示例 ​

创建暗调面光源并设置尺寸 ​

lua
-- @runtime server
local world = game:GetService("World")

local light = world:CreateUnit("SimpleAreaShadowLight", {
    Position = Vector3.New(0, 3, 10),
    Color = Color.New(0, 255, 102, 255),
    Size = Vector2.New(4, 3),
})
print("SimpleAreaShadowLight:", light)

属性 (3) ​

Name类型默认值说明
ColorColorColor.New(255, 255, 255, 255)设置或获取面阴影光源的颜色。
SizeVector2[1.0, 1.0]尺寸
TransparencyFloat0.6控制光源模型的透明度;值越小越透明(越暗)。实际显示效果需在目标渲染环境确认。

关联类型 ​