主题
SimpleLineShadowLight
概览
| 字段 | 值 |
|---|---|
| Kind | Unit · 单位 Unit |
| Realm | common |
继承关系
- Unit(5 属性 / 28 函数 / 6 事件)
- SimpleLight(7 属性)
- [SimpleLineShadowLight](4 属性)
- SimpleLight(7 属性)
继承成员
2 个来源 / 12 属性 / 28 函数 / 6 事件
- 来自 SimpleLight(7 属性)
- 来自 Unit(5 属性 / 28 函数 / 6 事件)
- 属性:
AssetId、Name、Desc、Parent、Tags - 函数:
ClearAllChildren、GetChildren、GetDescendants、IsAncestorOf、IsDescendantOf、FindFirstAncestor、FindFirstAncestorWhichIsA、FindFirstAncestorOfClass、FindFirstChild、FindFirstChildWhichIsA、FindFirstChildOfClass、HasChildren、GetChildCount、GetChildAtIndex、SetAttribute、GetAttribute、GetAllProps、Clone、IsA、Destroy、GetPropertyChangedSignal、GetAttributeChangedSignal、FindFromPath、GetFullPath、GetDebugId、HasTag、AddTag、RemoveTag - 事件:
ChildAdded、ChildRemoved、DescendantAdded、DescendantRemoving、AncestryChanged、Destroying
- 属性:
SimpleLineShadowLight 是支持双色渐变的暗调线状自发光体,不会向周围物体投射真实照明。
适用场景
用于暗色走廊边缘、地牢轮廓或科幻场景中的低亮度线条装饰。
使用要点
通过 World:CreateUnit("SimpleLineShadowLight", config) 创建实例,用 Color/Color2 设置两端颜色,并用 Pivot 调整渐变中点。
注意事项
当前运行包实测 SimpleLineShadowLight 即使创建后挂到 WorldUnit 也没有视觉表现,且公开 API 未说明可用的光照挂载结构。以下代码只展示属性形态,不能作为可见效果验收;在引擎补齐挂载契约或可用预设前,不建议用于正式内容。
代码示例
创建暗调双色线光源
lua
-- @runtime server
local world = game:GetService("World")
local light = world:CreateUnit("SimpleLineShadowLight", {
Position = Vector3.New(-10, 3, 0),
Color = Color.New(255, 0, 255, 255),
Color2 = Color3.New(255, 0, 102),
Pivot = 0.5,
})
light.Pivot = 0.0
print("SimpleLineShadowLight:", light)属性 (4)
| Name | 类型 | 默认值 | 说明 |
|---|---|---|---|
Color | Color3 | Color3.New(255, 255, 255) | Color 是 SimpleLineShadowLight 上可编辑的颜色属性,类型为 Color3,用于配置该单位的第一组颜色。 |
Color2 | Color3 | Color3.New(255, 255, 255) | Color2 是 SimpleLineShadowLight 上可编辑的颜色属性,类型为 Color3,用于配置该单位的第二组颜色。 |
Pivot | Float | 0.5 | 线条阴影光的中间点位置,用于调整光线的中心偏移。 |
Transparency | Float | 0.6 | 控制 SimpleLineShadowLight 的阴影透明度。值越大,阴影越透明。 |
