22 lines
675 B
C#
22 lines
675 B
C#
using UnityEngine;
|
|
|
|
public class HideIfSettingFalse : MonoBehaviour {
|
|
public SettingTypes setting;
|
|
public bool reverse;
|
|
|
|
void Start() {
|
|
bool value = GetSettingValue(setting);
|
|
gameObject.SetActive(value == !reverse);
|
|
}
|
|
|
|
bool GetSettingValue(SettingTypes s) {
|
|
var b = BazookaManager.Instance;
|
|
return s switch {
|
|
SettingTypes.FullScreen => b.GetSettingFullScreen() ?? false,
|
|
SettingTypes.ShowFPS => b.GetSettingShowFPS(),
|
|
SettingTypes.Vsync => b.GetSettingVsync() ?? false,
|
|
SettingTypes.HideSocials => b.GetSettingHideSocials() ?? false,
|
|
_ => false
|
|
};
|
|
}
|
|
} |