index.js 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Component({
  2. behaviors: [require('../common/share-behavior').default],
  3. properties: {
  4. capacity: {
  5. type: Number,
  6. value: 20
  7. },
  8. emitRate: {
  9. type: Number,
  10. value: 5
  11. },
  12. lifeTime:{
  13. type: Number,
  14. value: 3
  15. }
  16. },
  17. data: {
  18. loaded: false
  19. },
  20. lifetimes: {},
  21. methods: {
  22. handleReady({detail}) {
  23. const xrScene = this.scene = detail.value;
  24. const portal = xrScene.getElementById("portal");
  25. const xrFrameSystem = wx.getXrFrameSystem();
  26. const tempSystem = portal.getComponent('custom-particle');
  27. tempSystem.addSizeGradient(0,1,1);
  28. tempSystem.addSizeGradient(0.5,0.8,0.8);
  29. tempSystem.addSizeGradient(0.75,0.5,0.5);
  30. tempSystem.addSizeGradient(0.9,0.2,0.2);
  31. tempSystem.addSizeGradient(1,0,0);
  32. },
  33. handleAssetsProgress: function({detail}) {
  34. console.log('assets progress', detail.value);
  35. },
  36. handleAssetsLoaded: function({detail}) {
  37. }
  38. }
  39. })