81 lines
2.0 KiB
C#
81 lines
2.0 KiB
C#
using DG.Tweening.Plugins.Options;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SettingsMenu : Menu<SettingsMenu>
|
|
{
|
|
|
|
public bool isMusicOn = true;
|
|
public bool isSfxOn = true;
|
|
public bool isDubbingOn = true;
|
|
|
|
|
|
public override void OnBackPressed()
|
|
{
|
|
base.OnBackPressed();
|
|
audioController.Instance.PlaySFX("TombolClose", 0.5f);
|
|
}
|
|
|
|
public void SwapSoundMusic()
|
|
{
|
|
if (isMusicOn)
|
|
{
|
|
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
|
|
|
|
isMusicOn = false;
|
|
audioController.Instance.bgmSource.mute = true;
|
|
Debug.Log(("Music mati"));
|
|
}
|
|
else if (!isMusicOn)
|
|
{
|
|
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
|
|
|
|
isMusicOn = true;
|
|
audioController.Instance.bgmSource.mute = false;
|
|
Debug.Log(("Music hidup"));
|
|
}
|
|
}
|
|
|
|
public void SwapSoundSfx()
|
|
{
|
|
if (isSfxOn)
|
|
{
|
|
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
|
|
|
|
isSfxOn = false;
|
|
audioController.Instance.sfxSource.mute = true;
|
|
Debug.Log(("Music mati"));
|
|
}
|
|
else if (!isSfxOn)
|
|
{
|
|
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
|
|
|
|
isSfxOn = true;
|
|
audioController.Instance.sfxSource.mute = false;
|
|
Debug.Log(("Music hidup"));
|
|
}
|
|
}
|
|
|
|
public void SwapSoundDubbing()
|
|
{
|
|
if (isDubbingOn)
|
|
{
|
|
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
|
|
isDubbingOn = false;
|
|
audioController.Instance.dubbingSource.mute = true;
|
|
Debug.Log(("Music mati"));
|
|
}
|
|
else if (!isDubbingOn)
|
|
{
|
|
audioController.Instance.PlaySFX("TombolUmum", 0.5f);
|
|
|
|
isDubbingOn = true;
|
|
audioController.Instance.dubbingSource.mute = false;
|
|
Debug.Log(("Music hidup"));
|
|
}
|
|
}
|
|
|
|
}
|