@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.
36 lines (35 loc) • 1.55 kB
TypeScript
import { Behaviour, GameObject } from "./Component.js";
import { type IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js";
/**
* The Duplicatable component is used to duplicate a assigned {@link GameObject} when a pointer event occurs on the GameObject.
* It implements the {@link IPointerEventHandler} interface and can be used to expose duplication to the user in the editor without writing code.
* @category Interactivity
* @group Components
*/
export declare class Duplicatable extends Behaviour implements IPointerEventHandler {
/** Duplicates will be parented into the set object. If not defined, this GameObject will be used as parent. */
parent: GameObject | null;
/** The object to be duplicated. If no object is assigned then the object the Duplicatable component is attached to will be used for cloning.
* @default null
*/
object: GameObject | null;
/**
* The maximum number of objects that can be duplicated in the interval.
* @default 60
*/
limitCount: number;
private _currentCount;
private _startPosition;
private _startQuaternion;
start(): void;
onEnable(): void;
private _forwardPointerEvents;
onPointerEnter(args: PointerEventData): void;
onPointerExit(args: PointerEventData): void;
/** @internal */
onPointerDown(args: PointerEventData): void;
/** @internal */
onPointerUp(args: PointerEventData): void;
private cloneLimitIntervalFn;
private handleDuplication;
}