See <ComponentProps>
A portion of the configuration object to pass to the SpawnAreaComponent
constructor.
type SpawnAreaComponentPropsV1 = {
size?: number | undefined;
groundLayers?: number | undefined;
avoidLayers?: number | undefined;
isAligningNormal?: boolean | undefined;
maxAcceptableAngleDot?: number | undefined;
};
type SpawnAreaComponentProps = SpawnAreaComponentPropsV1;
size
(optional, default5
)<number>
groundLayers
(optional, default1280
)<number>
avoidLayers
(optional, default8721
)<number>
isAligningNormal
(optional, defaultfalse
)<boolean>
maxAcceptableAngleDot
(optional, default-1
)<number>
Creates a versioned SpawnArea
component.
props
<ComponentProps & SpawnAreaComponentProps>
Configuration of the component to create.- Returns:
<SpawnAreaComponent>
import { SpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SpawnAreaComponent({ version: componentVersion });
See Component.fromBinary(reader, version)
Note that the following properties are sorted in order of appearance when decoding component binary data.
See Component.hash
See Component.name
The size (in metres) of the spawn area of the prefab this component is attached to.
- Since:
v1
<number>
import { SpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SpawnAreaComponent({ version: componentVersion });
const size = component.size;
// `size` is `5`
- Since:
v1
<number>
import { SpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SpawnAreaComponent({ version: componentVersion });
const groundLayers = component.groundLayers;
// `groundLayers` is `1280`
- Since:
v1
<number>
import { SpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SpawnAreaComponent({ version: componentVersion });
const avoidLayers = component.avoidLayers;
// `avoidLayers` is `8721`
- Since:
v1
<boolean>
import { SpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SpawnAreaComponent({ version: componentVersion });
const isAligningNormal = component.isAligningNormal;
// `isAligningNormal` is `false`
- Since:
v1
<number>
import { SpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SpawnAreaComponent({ version: componentVersion });
const maxAcceptableAngleDot = component.maxAcceptableAngleDot;
// `maxAcceptableAngleDot` is `-1`
See Component.toBinary(version?)