Skip to content

SimplePointShadowLight

概览

字段
KindUnit · 单位 Unit
Realmcommon

继承关系

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

继承成员

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

SimplePointShadowLight 是暗调点状自发光体,用较深颜色呈现球状装饰光效,不会照亮周围物体。

适用场景

用于低亮度指示点、暗色魔法球或环境中的点状自发光装饰。

使用要点

通过 World:CreateUnit("SimplePointShadowLight", config) 创建实例,设置 Color 调整暗调外观,通过 AttenuationEnable 控制视觉衰减。

注意事项

当前运行包实测 SimplePointShadowLight 即使创建后挂到 WorldUnit 也没有视觉表现,且公开 API 未说明可用的光照挂载结构。以下代码只展示属性形态,不能作为可见效果验收;在引擎补齐挂载契约或可用预设前,不建议用于正式内容。

代码示例

创建暗调点光源

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

local light = world:CreateUnit("SimplePointShadowLight", {
    Position = Vector3.New(10, 3, 0),
    Color = Color.New(102, 102, 255, 255),
    AttenuationEnable = true,
})
print("SimplePointShadowLight:", light)

属性 (3)

Name类型默认值说明
ColorColorColor.New(255, 255, 255, 255)暗调点状自发光体的颜色。
AttenuationEnableBooltrue是否启用暗调点状自发光外观的距离衰减。
TransparencyFloat0.6控制 SimplePointShadowLight 暗调点光源的模型透明度,数值越高光源模型越透明。

关联类型