@playcanvas/web-components 0.2.10 → 0.2.12

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.
@@ -11,11 +11,13 @@ import { ComponentElement } from './component';
11
11
  declare class SplatComponentElement extends ComponentElement {
12
12
  private _asset;
13
13
  private _castShadows;
14
+ private _unified;
14
15
  /** @ignore */
15
16
  constructor();
16
17
  getInitialComponentData(): {
17
18
  asset: import("playcanvas").Asset | null | undefined;
18
19
  castShadows: boolean;
20
+ unified: boolean;
19
21
  };
20
22
  /**
21
23
  * Gets the underlying PlayCanvas splat component.
@@ -42,6 +44,17 @@ declare class SplatComponentElement extends ComponentElement {
42
44
  * @returns Whether the splat casts shadows.
43
45
  */
44
46
  get castShadows(): boolean;
47
+ /**
48
+ * Sets whether the splat supports global sorting and LOD streaming. This property can only be
49
+ * changed when the component is disabled.
50
+ * @param value - Whether the splat supports global sorting and LOD streaming.
51
+ */
52
+ set unified(value: boolean);
53
+ /**
54
+ * Gets whether the splat supports global sorting and LOD streaming.
55
+ * @returns Whether the splat supports global sorting and LOD streaming.
56
+ */
57
+ get unified(): boolean;
45
58
  static get observedAttributes(): string[];
46
59
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
47
60
  }
package/dist/pwc.cjs CHANGED
@@ -4259,11 +4259,13 @@ class SplatComponentElement extends ComponentElement {
4259
4259
  super('gsplat');
4260
4260
  this._asset = '';
4261
4261
  this._castShadows = false;
4262
+ this._unified = false;
4262
4263
  }
4263
4264
  getInitialComponentData() {
4264
4265
  return {
4265
4266
  asset: AssetElement.get(this._asset),
4266
- castShadows: this._castShadows
4267
+ castShadows: this._castShadows,
4268
+ unified: this._unified
4267
4269
  };
4268
4270
  }
4269
4271
  /**
@@ -4308,11 +4310,34 @@ class SplatComponentElement extends ComponentElement {
4308
4310
  get castShadows() {
4309
4311
  return this._castShadows;
4310
4312
  }
4313
+ /**
4314
+ * Sets whether the splat supports global sorting and LOD streaming. This property can only be
4315
+ * changed when the component is disabled.
4316
+ * @param value - Whether the splat supports global sorting and LOD streaming.
4317
+ */
4318
+ set unified(value) {
4319
+ if (this.component && this.component.enabled) {
4320
+ console.warn('The "unified" property can only be changed when the component is disabled.');
4321
+ return;
4322
+ }
4323
+ this._unified = value;
4324
+ if (this.component) {
4325
+ this.component.unified = value;
4326
+ }
4327
+ }
4328
+ /**
4329
+ * Gets whether the splat supports global sorting and LOD streaming.
4330
+ * @returns Whether the splat supports global sorting and LOD streaming.
4331
+ */
4332
+ get unified() {
4333
+ return this._unified;
4334
+ }
4311
4335
  static get observedAttributes() {
4312
4336
  return [
4313
4337
  ...super.observedAttributes,
4314
4338
  'asset',
4315
- 'cast-shadows'
4339
+ 'cast-shadows',
4340
+ 'unified'
4316
4341
  ];
4317
4342
  }
4318
4343
  attributeChangedCallback(name, _oldValue, newValue) {
@@ -4324,6 +4349,9 @@ class SplatComponentElement extends ComponentElement {
4324
4349
  case 'cast-shadows':
4325
4350
  this.castShadows = this.hasAttribute('cast-shadows');
4326
4351
  break;
4352
+ case 'unified':
4353
+ this.unified = this.hasAttribute('unified');
4354
+ break;
4327
4355
  }
4328
4356
  }
4329
4357
  }