UNPKG

@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.

20 lines (19 loc) 645 B
import { Color } from "three"; import { Behaviour } from "./Component.js"; /** * 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. * @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; }