index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. console.log('xr-scene', xrScene);
  25. const xrFrameSystem = wx.getXrFrameSystem()
  26. const portal = xrScene.getElementById("portal");
  27. const tempSystem = portal.getComponent(xrFrameSystem.Particle)
  28. tempSystem.addSizeGradient(0,1,1);
  29. tempSystem.addSizeGradient(0.5,0.8,0.8);
  30. tempSystem.addSizeGradient(0.75,0.5,0.5);
  31. tempSystem.addSizeGradient(0.9,0.2,0.2);
  32. tempSystem.addSizeGradient(1,0,0);
  33. },
  34. handleAssetsProgress: function({detail}) {
  35. console.log('assets progress', detail.value);
  36. },
  37. handleAssetsLoaded: function({detail}) {
  38. console.log('assets loaded', detail.value);
  39. this.setData({loaded: true});
  40. }
  41. }
  42. })