xr-custom-particle.ts 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import XrFrame from 'XrFrame';
  2. const xrFrameSystem = wx.getXrFrameSystem();
  3. export const CustomParticleDefaultComponents: XrFrame.IEntityComponents = Object.assign({
  4. 'custom-particle': {}
  5. }, xrFrameSystem.NodeDefaultComponents);
  6. export const CustomParticleDataMapping: { [key: string]: string[] } = Object.assign({
  7. 'never-cull': ['custom-particle', 'neverCull'],
  8. uniforms: ['custom-particle', 'uniforms'],
  9. states: ['custom-particle', 'states'],
  10. 'atlas': ['custom-particle', 'atlas'],
  11. 'atlas-frames': ['custom-particle', 'atlasFrames'],
  12. 'atlas-loop': ['custom-particle', 'atlasLoop'],
  13. 'atlas-speed': ['custom-particle', 'atlasSpeed'],
  14. 'atlas-random': ['custom-particle', 'atlasRandom'],
  15. angle: ['custom-particle', 'angle'],
  16. 'angular-speed': ['custom-particle', 'angularSpeed'],
  17. 'burst-count': ['custom-particle', 'burstCount'],
  18. 'burst-time': ['custom-particle', 'burstTime'],
  19. 'burst-cycle': ['custom-particle', 'burstCycle'],
  20. 'burst-interval': ['custom-particle', 'burstInterval'],
  21. capacity: ['custom-particle', 'capacity'],
  22. delay: ['custom-particle', 'delay'],
  23. 'emit-rate': ['custom-particle', 'emitRate'],
  24. 'emitter-type': ['custom-particle', 'emitterType'],
  25. 'emitter-props': ['custom-particle', 'emitterProps'],
  26. 'emitter-position': ['custom-particle', 'emitterPosition'],
  27. 'end-color': ['custom-particle', 'endColor'],
  28. gravity: ['custom-particle', 'gravity'],
  29. 'life-time': ['custom-particle', 'lifeTime'],
  30. 'render-mode': ['custom-particle', 'renderMode'],
  31. 'render-model': ['custom-particle', 'renderModel'],
  32. size: ['custom-particle', 'size'],
  33. 'stop-duration': ['custom-particle', 'stopDuration'],
  34. speed: ['custom-particle', 'speed'],
  35. 'start-color': ['custom-particle', 'startColor'],
  36. 'start-color2': ['custom-particle', 'startColor2'],
  37. texture: ['custom-particle', 'texture'],
  38. 'scale-x': ['custom-particle', 'scaleX'],
  39. 'scale-y': ['custom-particle', 'scaleY'],
  40. 'prewarm-cycles': ['custom-particle', 'prewarmCycles'],
  41. 'speed-dampen': ['custom-particle', 'speedDampen'],
  42. 'mesh': ['custom-particle', 'mesh'],
  43. 'size-change': ['custom-particle', 'sizeChange'],
  44. 'color-change': ['custom-particle', 'colorChange'],
  45. 'speed-change': ['custom-particle', 'speedChange'],
  46. }, xrFrameSystem.NodeDataMapping);
  47. xrFrameSystem.registerElement('custom-particle', class XRCustomParticle extends xrFrameSystem.Element {
  48. public readonly defaultComponents: XrFrame.IEntityComponents = CustomParticleDefaultComponents;
  49. public readonly dataMapping: { [key: string]: string[] } = CustomParticleDataMapping;
  50. })