Button_Pet.js 698 B

1234567891011121314151617181920212223242526272829
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. button: cc.Button,
  5. },
  6. // 存储数据:cc.sys.localStorage.setItem(“key”,”value”)
  7. // 获取数据:cc.sys.localStorage.getItem(“key”)
  8. // 移除数据:cc.sys.localStorage.removeItem(“key”)
  9. // 清除所有:cc.sys.localStorage.clear()
  10. // use this for initialization
  11. onLoad: function () {
  12. this.button.node.on('click', this.callback, this);
  13. },
  14. // called every frame
  15. update: function (dt) {
  16. },
  17. callback: function (event) {
  18. Audio.playeffect('resources/audio/sound_click.mp3');
  19. Global.Style = 0;
  20. cc.director.loadScene('Level');
  21. }
  22. });