Spelunx Cavern SDK
 
Loading...
Searching...
No Matches
ToggleFullscreenGameView.cs
Go to the documentation of this file.
1using UnityEditor;
2
3
4namespace Spelunx.Fullscreen
5{
6 public class ToggleFullscreenGameView : Editor
7 {
8 public const string MenuPathPrefix = "CAVERN";
10 private const string FullMenuPath = MenuPathPrefix + "/" + IsEnabledBoolPath;
11
12 [MenuItem(FullMenuPath)]
13 public static void ToggleIsEnabled()
14 {
15 EditorPrefs.SetBool(IsEnabledBoolPath, !EditorPrefs.GetBool(IsEnabledBoolPath, false));
16 Menu.SetChecked(FullMenuPath, EditorPrefs.GetBool(IsEnabledBoolPath, false));
17 }
18
19 [MenuItem(FullMenuPath, true)]
20 public static bool ToggleIsEnabledValidate()
21 {
22 Menu.SetChecked(FullMenuPath, EditorPrefs.GetBool(IsEnabledBoolPath, false));
23 return true;
24 }
25 }
26}