add project files
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using OHM.UnityToolkit;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class UISettings : UIMenu
|
||||
{
|
||||
[SerializeField]
|
||||
private TextWrapper version;
|
||||
|
||||
[SerializeField]
|
||||
private Toggle vibrationToggle;
|
||||
|
||||
[SerializeField]
|
||||
private Toggle soundsToggle;
|
||||
|
||||
[SerializeField]
|
||||
[FormerlySerializedAs("toggleSettings")]
|
||||
private Toggle _toggleSettings;
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
InitVibrate();
|
||||
InitSounds();
|
||||
if (version != null)
|
||||
{
|
||||
version.text = VersionUtils.GetVersionData().GetVersionLongName();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitVibrate()
|
||||
{
|
||||
if (vibrationToggle != null)
|
||||
{
|
||||
vibrationToggle.isOn = AppSettings.Instance.VibrationsEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
public void InitSounds()
|
||||
{
|
||||
if (soundsToggle != null)
|
||||
{
|
||||
soundsToggle.isOn = AppSettings.Instance.AudioEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleVibrate(bool on)
|
||||
{
|
||||
AppSettings.Instance.VibrationsEnabled = on;
|
||||
}
|
||||
|
||||
public void ToggleAudio(bool on)
|
||||
{
|
||||
AppSettings.Instance.AudioEnabled = on;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user