SettingSound.js 811 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_Sound, Tag.progress.toFixed(1));
  21. },
  22. //////////////////////////////////////////////////
  23. SetGame: function (GameDef) {
  24. this.m_GameDef = GameDef;
  25. },
  26. Load: function() {
  27. this.InitView();
  28. this.m_Slider.SetProgress(window.g_Setting[window.SetKey_Sound]);
  29. },
  30. });