35 lines
878 B
C#
35 lines
878 B
C#
|
|
using UnityEditor;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
#if UNITY_EDITOR
|
|||
|
|
public class FixedMainEditor
|
|||
|
|
{
|
|||
|
|
private const string FixedMainKey = "IsFixedMain";
|
|||
|
|
public static bool isFixedMain
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return PlayerPrefs.GetInt(FixedMainKey, 0) == 1;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
PlayerPrefs.SetInt(FixedMainKey, value ? 1 : 0);
|
|||
|
|
PlayerPrefs.Save();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[MenuItem("Tools/ǿ<><C7BF>Main<69><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %#x", false, 10)]
|
|||
|
|
private static void ToggleOption()
|
|||
|
|
{
|
|||
|
|
isFixedMain = !isFixedMain;
|
|||
|
|
EditorUtility.DisplayDialog("Option Status", "Option is now " + (isFixedMain ? "enabled" : "disabled"), "OK");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[MenuItem("Tools/ǿ<><C7BF>Main<69><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %#x", true, 10)]
|
|||
|
|
private static bool ValidateToggleOption()
|
|||
|
|
{
|
|||
|
|
Menu.SetChecked("Tools/ǿ<><C7BF>Main<69><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", isFixedMain);
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endif
|