Skip to content

Latest commit

 

History

History
113 lines (70 loc) · 2.8 KB

PhysicalMaterialPartComponent.md

File metadata and controls

113 lines (70 loc) · 2.8 KB

Class: PhysicalMaterialPartComponent

Types

<ComponentProps>

See <ComponentProps>


<PhysicalMaterialPartComponentProps>

A portion of the configuration object to pass to the PhysicalMaterialPartComponent constructor.

type PhysicalMaterialPartComponentPropsV1 = {
  materialHash?: number | undefined;
};

type PhysicalMaterialPartComponentProps = PhysicalMaterialPartComponentPropsV1;

Since v1

Constructors

new PhysicalMaterialPartComponent(props)

Creates a versioned PhysicalMaterialPart component.

import { PhysicalMaterialPartComponent } from 'att-string-transcoder';

const componentVersion = 1;
const component = new PhysicalMaterialPartComponent({ version: componentVersion });

PhysicalMaterialPartComponent.fromBinary(reader, version)

See Component.fromBinary(reader, version)

Properties

Note that the following properties are sorted in order of appearance when decoding component binary data.

hash

See Component.hash


name

See Component.name


version

See Component.version


materialHash

The hash of the physical material of the prefab this component is attached to.

import { PhysicalMaterialPartComponent } from 'att-string-transcoder';

const componentVersion = 1;
const component = new PhysicalMaterialPartComponent({ version: componentVersion });

const materialHash = component.materialHash;
// `materialHash` is `1`

Methods

toBinary(version?)

See Component.toBinary(version?)


write(writer, version?)

See Component.write(writer, version?)