@dcl/sdk 7.0.0-3292932605.commit-396fe92 → 7.0.0-3314076256.commit-c624ad4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1227,6 +1227,11 @@ export declare type IEngine = {
1227
1227
  * @param entity
1228
1228
  */
1229
1229
  removeEntity(entity: Entity): void;
1230
+ /**
1231
+ * Remove all components of each entity in the tree made with Transform parenting
1232
+ * @param firstEntity - the root entity of the tree
1233
+ */
1234
+ removeEntityWithChildren(firstEntity: Entity): void;
1230
1235
  /**
1231
1236
  * Add the system to the engine. It will be called every tick updated.
1232
1237
  * @param system function that receives the delta time between last tick and current one.
@@ -1333,6 +1338,53 @@ export declare type IEngineParams = {
1333
1338
  */
1334
1339
  declare function IEnum<T>(type: ISchema<any>): ISchema<T>;
1335
1340
 
1341
+ /**
1342
+ * @public
1343
+ */
1344
+ export declare type IInput = {
1345
+ /**
1346
+ * Check if a click was emmited in the current tick for the input action.
1347
+ * This is defined when an UP event is triggered with a previously DOWN state.
1348
+ * @param inputAction - the input action to query
1349
+ * @param entity - the entity to query, ignore for global events.
1350
+ * @returns true if the entity was clicked in the last tick-update
1351
+ */
1352
+ wasJustClicked: (inputAction: InputAction, entity?: Entity) => boolean;
1353
+ /**
1354
+ * Check if a pointer event has been emited in the last tick-update.
1355
+ * @param inputAction - the input action to query
1356
+ * @param pointerEventType - the pointer event type to query
1357
+ * @param entity - the entity to query, ignore for global
1358
+ * @returns
1359
+ */
1360
+ wasInputJustActive: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => boolean;
1361
+ /**
1362
+ * Check if an input action is in DOWN state.
1363
+ * @param inputAction - the input action to query
1364
+ * @returns true if the input action is being pressed
1365
+ */
1366
+ isActionDown: (inputAction: InputAction) => boolean;
1367
+ /**
1368
+ * Get the click info if a click was emmited in the current tick for the input action.
1369
+ * This is defined when an UP event is triggered with a previously DOWN state.
1370
+ * @param inputAction - the input action to query
1371
+ * @param entity - the entity to query, ignore for global events.
1372
+ * @returns the click info or undefined if there is no command in the last tick-update
1373
+ */
1374
+ getClick: (inputAction: InputAction, entity?: Entity) => {
1375
+ up: PBPointerEventsResult_PointerCommand;
1376
+ down: PBPointerEventsResult_PointerCommand;
1377
+ } | null;
1378
+ /**
1379
+ * Get the input command info if a pointer event has been emited in the last tick-update.
1380
+ * @param inputAction - the input action to query
1381
+ * @param pointerEventType - the pointer event type to query
1382
+ * @param entity - the entity to query, ignore for global
1383
+ * @returns the input command info or undefined if there is no command in the last tick-update
1384
+ */
1385
+ getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => PBPointerEventsResult_PointerCommand | null;
1386
+ };
1387
+
1336
1388
  /**
1337
1389
  * @public
1338
1390
  */
@@ -1343,6 +1395,11 @@ declare type IncludeUndefined<T> = {
1343
1395
  [P in keyof T]: undefined extends T[P] ? P : never;
1344
1396
  }[keyof T];
1345
1397
 
1398
+ /**
1399
+ * @public
1400
+ */
1401
+ export declare const Input: IInput;
1402
+
1346
1403
  declare const enum InputAction {
1347
1404
  IA_POINTER = 0,
1348
1405
  IA_PRIMARY = 1,
@@ -1374,10 +1431,6 @@ export declare type ISchema<T = any> = {
1374
1431
  create(): T;
1375
1432
  };
1376
1433
 
1377
- export declare const isPointerEventActive: (entity: Entity, actionButton: InputAction, pointerEventType: PointerEventType) => boolean;
1378
-
1379
- export declare function isPointerEventActiveGenerator(engine: IEngine): (entity: Entity, actionButton: InputAction, pointerEventType: PointerEventType) => boolean;
1380
-
1381
1434
  export declare const log: (...a: any[]) => void;
1382
1435
 
1383
1436
  /**
@@ -4245,10 +4298,6 @@ declare interface Vector3_2 {
4245
4298
  /** @public */
4246
4299
  export declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
4247
4300
 
4248
- export declare const wasEntityClicked: (entity: Entity, actionButton: InputAction) => boolean;
4249
-
4250
- export declare function wasEntityClickedGenerator(engine: IEngine): (entity: Entity, actionButton: InputAction) => boolean;
4251
-
4252
4301
  declare namespace WireMessage {
4253
4302
  enum Enum {
4254
4303
  RESERVED = 0,