EnvironmentCloudsOverride
Since next
Fields of meta.environment.sky.clouds (an atmosphere sky's layer), the ones a weather change reaches for named; any other may be written too.
Signature
export interface EnvironmentCloudsOverride {
/** `clear`, `fair`, `broken`, `overcast` or `storm`. */
preset?: string | null
/** How much of the sky the layer covers, 0..1. */
coverage?: number | null
/** Multiplier on the preset's density. */
density?: number | null
[field: string]: unknown
}
Import: import type { EnvironmentCloudsOverride } from "@argus/api"
Members
| Member | Signature | Description |
|---|---|---|
preset | preset?: string | null | clear, fair, broken, overcast or storm. |
coverage | coverage?: number | null | How much of the sky the layer covers, 0..1. |
density | density?: number | null | Multiplier on the preset's density. |
Example
The tested fixture fixtures/app/sliding-door.ts.
import type { Behavior } from "@argus/api"
// Matches the `script` component on the door in `fixtures/contract/full20/scene.json`.
// Opens on the event named by `props.openOn`, which is also how the event path gets
// exercised by the component-coverage test.
export default {
init(ctx) {
ctx.state.open = false
ctx.state.closed = ctx.entity.position
},
onEvent(ctx, ev) {
if (ev.name === ctx.props.openOn) ctx.state.open = true
},
update(ctx, dt) {
if (!ctx.state.open) return
const closed = ctx.state.closed as [number, number, number]
const target: [number, number, number] = [closed[0], closed[1] + 2.2, closed[2]]
ctx.entity.moveToward(target, (ctx.props.speed as number) * dt)
},
} satisfies Behavior