@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
22 lines (21 loc) • 737 B
TypeScript
import { Color } from "three";
import { Behaviour } from "./Component.js";
/**
* [PlayerColor](https://engine.needle.tools/docs/api/PlayerColor) Assigns a unique color for each user in the room to the object it is attached to.
* The color is generated based on the user's ID.
*
* @summary Assigns a unique color to the player object
* @category Networking
* @group Components
*/
export declare class PlayerColor extends Behaviour {
private _didAssignPlayerColor;
onEnable(): void;
onDisable(): void;
private waitForConnection;
private tryAssignColor;
assignUserColor(id: string): void;
private assignColor;
static hashCode(str: string): number;
static colorFromHashCode(hash: number): Color;
}