void Start() { volumeSetting = FindObjectOfType <VolumeSetting>(); gameObject.AddComponent <AudioSource>(); audioSourceBackgroundMusic.clip = backgroundMusic; audioSourceCoin.clip = coinPickedSound; audioSourceLevelCompleted.clip = levelCompletedSound; audioSourcePlayerDead.clip = playerDeadSound; audioSourceGameOver.clip = gameOverSound; audioSourcePlayerJump.clip = playerJumpSound; audioSourceGameCompleted.clip = gameCompletedSound; PlayBackgroundMusic(); }
public override void Load(string dir) { string path = Path.Combine(dir, "VolumeSetting.txt");// + ".txt" if (!File.Exists(path)) { return; } /* * Debug.LogWarning("m_VolumeSetting.m_SE:" + m_VolumeSetting.m_SE); * Debug.LogWarning("m_VolumeSetting.m_Volume:" + m_VolumeSetting.m_Volume); * Debug.LogWarning("m_VolumeSetting.m_DD:" + m_VolumeSetting.m_DD); */ m_VolumeSetting = Core.FileLib.Lib.DeserializeFromFile <VolumeSetting>(path); //Core.FileLib.Lib.ReadBinaryFromFile<VolumeSetting>(path); /* * Debug.LogWarning("Prev m_VolumeSetting.m_SE:" + m_VolumeSetting.m_SE); * Debug.LogWarning("Prev m_VolumeSetting.m_Volume:" + m_VolumeSetting.m_Volume); * Debug.LogWarning("Prev m_VolumeSetting.m_DD:" + m_VolumeSetting.m_DD); */ }
public SettingsViewModel() { PanelColor = new PanelColorSetting() { Name = nameof(PanelOpacity) }; PrimaryColor = new PrimaryColorSetting() { Name = nameof(PrimaryColor) }; SecondaryColor = new ColorSetting() { Name = nameof(SecondaryColor) }; SecondaryColorL = new ColorSetting() { Name = nameof(SecondaryColorL) }; ForegroundColor = new ColorSetting() { Name = nameof(ForegroundColor) }; ForegroundColorL = new ColorSetting() { Name = nameof(ForegroundColorL) }; LyricForegroundColor = new ColorSetting() { Name = nameof(LyricForegroundColor) }; LyricHighlightColor = new ColorSetting() { Name = nameof(LyricHighlightColor) }; LyricShadowColor = new ShadowColorSetting() { Name = "LyricShadowEffect" }; TextShadowColor = new ShadowColorSetting() { Name = "TextShadowEffect" }; PrimaryFont = new FontSetting() { Name = nameof(PrimaryFont) }; LyricFont = new FontSetting() { Name = nameof(LyricFont) }; TextMediumFontSize = new DoubleSetting() { Name = nameof(TextMediumFontSize) }; TextSmallFontSize = new DoubleSetting() { Name = nameof(TextSmallFontSize) }; LyricMediumFontSize = new DoubleSetting() { Name = nameof(LyricMediumFontSize) }; LyricSmallFontSize = new DoubleSetting() { Name = nameof(LyricSmallFontSize) }; PanelOpacity = new OpacitySetting() { Name = nameof(PanelOpacity) }; MusicVolume = new VolumeSetting() { Name = nameof(MusicVolume) }; BackgroundCoverVisibility = new VisibilitySetting() { Name = nameof(BackgroundCoverVisibility) }; MiniBackgroundCoverVisibility = new VisibilitySetting() { Name = nameof(MiniBackgroundCoverVisibility) }; }