See <ComponentProps>
A portion of the configuration object to pass to the PickupComponent
constructor.
type GrabPointParameters = null | {
grabPointIndex: number;
lastLinearPosition: number;
lastPosition: Position;
lastRotation: Rotation;
};
type PickupComponentPropsV1 = {
lastInteractorPlayerId?: number | undefined;
dockedMemory?: never;
};
type PickupComponentPropsV2 = {
lastInteractorPlayerId?: number | undefined;
dockedMemory?: GrabPointParameters[] | undefined;
};
type PickupComponentProps = PickupComponentPropsV1 | PickupComponentPropsV2;
lastInteractorPlayerId
(optional, default0
)<number>
lastInteractorPlayerId
(optional, default0
)<number>
dockedMemory
(optional, default[]
)<Array<GrabPointParameters>>
Creates a versioned Pickup
component.
props
<ComponentProps & PickupComponentProps>
Configuration of the component to create.- Returns:
<PickupComponent>
import { PickupComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PickupComponent({ 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 ID of the player that last interacted with the prefab that this component is attached to.
- Since:
v1
<number>
import { PickupComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PickupComponent({ version: componentVersion });
const lastInteractorPlayerId = component.lastInteractorPlayerId;
// `lastInteractorPlayerId` is `0`
An array of <GrabPointParameters>
that describes the orientation of prefabs when they were docked. Used to control in which orientation pickups should be held when grabbed from the dock attached to the same prefab this component is attached to.
- Since:
v2
<number>
import { PickupComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PickupComponent({ version: componentVersion });
const dockedMemory = component.dockedMemory;
// `dockedMemory` is `[]`
See Component.toBinary(version?)