See <ComponentProps>
A portion of the configuration object to pass to the SentGiftComponent constructor.
type Gift = null | {
data: number[];
messageSizeInBytes: number;
hash: number;
chunkVersioning: number[];
};
type SentGiftTag = null | {
from: number;
to: number;
};
type SentGiftComponentPropsV1 = {
receiverName?: string | undefined;
senderName?: string | undefined;
gifts?: Gift[] | undefined;
senderTag?: SentGiftTag | undefined;
};
type SentGiftComponentProps = SentGiftComponentPropsV1;receiverName(optional, default'')<string>senderName(optional, default'')<string>gifts(optional, default[])<Array<Gift>>senderTag(optional, defaultnull)<SentGiftTag>
Creates a versioned SentGift component.
props<ComponentProps & SentGiftComponentProps>Configuration of the component to create.- Returns:
<SentGiftComponent>
import { SentGiftComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SentGiftComponent({ 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
Name of the player intended as the receiver of the prefab this component is attached to.
- Since:
v1 <string>
import { SentGiftComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SentGiftComponent({ version: componentVersion });
const receiverName = component.receiverName;
// `receiverName` is `''`Name of the player intended as the sender of the prefab this component is attached to. This name will be displayed as a label on a gift box prefab.
- Since:
v1 <string>
import { SentGiftComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SentGiftComponent({ version: componentVersion });
const senderName = component.senderName;
// `senderName` is `''`Array of gifts, which are prefab save strings.
- Since:
v1 <Array<Gift>>
import { SentGiftComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SentGiftComponent({ version: componentVersion });
const gifts = component.gifts;
// `gifts` is `[]`- Since:
v3 <SentGiftTag>
import { SentGiftComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new SentGiftComponent({ version: componentVersion });
const senderTag = component.senderTag;
// `senderTag` is `null`See Component.toBinary(version?)