compileLight 编译光源对象
compileLight
类型: MethodDeclaration
所属类: CommandFunctionList
定义位置: command.ts
描述
编译光源对象
参数 light
: 光源访问器
返回值:光源访问器函数
参数
参数名 | 类型 | 描述 | 默认值 |
---|---|---|---|
light | LightGetter | - | - |
返回值
类型: () => SceneLight \| undefined
光源访问器函数
源代码
位置: 第 751 行
private compileLight(light: LightGetter): () => SceneLight | undefined {
switch (light.type) {
case 'trigger':
return () => Command.filterValidObject(CurrentEvent.triggerLight)
case 'latest':
return () => Command.filterValidObject(SceneLight.latest)
case 'by-id': {
const {presetId} = light
return () => {
return Scene.entity.get(presetId) as SceneLight | undefined
}
}
case 'variable': {
const getLight = Command.compileVariable(light.variable, Attribute.LIGHT_GET)
return Command.filterValidObject(getLight())
}
}
}
文档生成时间:2025/7/7 12:07:06