TextureCombiner/Assets/Scripts/Options/CombineOptions.cs

30 lines
605 B
C#
Raw Normal View History

2020-11-01 03:54:32 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace TextureCombiner
{
public class CombineOptions : Options
{
[SerializeField]
private Toggle autoCombineToggle = null;
private void OnEnable()
{
autoCombineToggle.isOn = PlayerPrefs.GetInt("autoCombine", 1) != 0;
}
protected override void OnDisable()
{
PlayerPrefs.SetInt("autoCombine", autoCombineToggle.isOn ? 1 : 0);
base.OnDisable();
}
public bool GetAutoCombine()
{
return autoCombineToggle.isOn;
}
}
}