endClick.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Learn cc.Class:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/class.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. cc.Class({
  8. extends: cc.Component,
  9. properties: {
  10. downLoad:cc.Node,
  11. downLoadElse:cc.Node,
  12. audio: {
  13. default: null,
  14. type: cc.AudioClip
  15. },
  16. },
  17. // LIFE-CYCLE CALLBACKS:
  18. onLoad () {
  19. if(this.pochan){
  20. console.log(this.pochan.scale)
  21. }
  22. },
  23. onDownLoad(e){
  24. // $('#btn').on('touchstart', function (e) {
  25. window.playableSDK.sendEvent('clickFinishDownloadBar', {
  26. section: 'section2',
  27. area: 'area3'
  28. });
  29. window.playableSDK.openAppStore()
  30. // })
  31. },
  32. agin(){
  33. if(localStorage.getItem('agin')){
  34. window.playableSDK.sendEvent('clickResurrection', { section: 'section2', area: 'area3' });
  35. window.playableSDK.openAppStore()
  36. }else{
  37. cc.director.loadScene("index");
  38. localStorage.setItem('agin',1)
  39. }
  40. },
  41. start () {
  42. let audioId = cc.audioEngine.playEffect(this.audio, false);
  43. cc.audioEngine.setVolume(audioId, 0.5);
  44. },
  45. // update (dt) {},
  46. });