DyeHair
Represents a dynamic component specifically designed for the DyeHair.
| Type | Name | Interface Description |
|---|---|---|
| Functions | constructor() | |
| Functions | getProperty(type: DyeHairPropertyKey): any | • Function: Gets a property value. The property key must match a supported Parameters • Returns Property value. |
| Functions | setProperty(type: DyeHairPropertyKey, value: any): boolean | • Function: Set property value. Parameters • • Returns Whether the property is set successfully. |
Examples
constructor()
let obj = new APJS.DyeHair();
setProperty(type: DyeHairPropertyKey, value: any): boolean
const hairObject = scene.findSceneObject("Hair Color");
const dyeHair = hairObject.getComponent('DyeHair') as DyeHair;
// set color to red in Full mode
dyeHair.setProperty("Color", new Color(1, 0, 0, 0.7));
// set coverage to 0.5
dyeHair.setProperty("Coverage", 0.5);
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use DyeHair here
}
onUpdate(deltaTime: number) {
}
}