SettingMusic.js 849 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. ctor: function () {
  6. },
  7. onLoad: function() {
  8. this.InitView();
  9. },
  10. start: function() {
  11. this.InitView();
  12. },
  13. OnShowView: function () {
  14. this.InitView();
  15. },
  16. InitView: function(){
  17. if (!this.m_Slider) this.m_Slider = this.$('Slider@CustomSlider');
  18. },
  19. OnSlider_Move: function (Tag) {
  20. window.SaveSetting(window.SetKey_Music, Tag.progress.toFixed(1));
  21. cc.gSoundRes.UpdateVolume();
  22. },
  23. //////////////////////////////////////////////////
  24. SetGame: function (GameDef) {
  25. this.m_GameDef = GameDef;
  26. },
  27. Load: function() {
  28. this.InitView();
  29. this.m_Slider.SetProgress(window.g_Setting[window.SetKey_Music]);
  30. },
  31. });