Search Issue Tracker
By Design
Votes
1
Found in
5.3.5f1
Issue ID
808147
Regression
No
Check status in Menu Item is reset when entering play mode
To reproduce:
1. Open attached project
2. Open AAA menu and notice that A is checked
3. Press play
4. Open AAA menu - A is unchecked, but it should be checked
Comments (3)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Build and Run button greyed out for locally invalid architecture, despite remote build is specified
- Graphics Settings: “Use Defaults” checkboxes misaligned in Tier Settings section
- VFX Graph particles are not culled when using URP and Frustum Culling is enabled on VFX Mesh Output
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
OndrejP
Jan 25, 2018 11:27
@NEILMILLSTONE
Validation method works for me in Unity 2017.3.0f2
private const string MenuItemName = "Tools/SOMETHING";
public static bool Enabled
{
get { return EditorPrefs.GetBool(MenuItemName, false); }
set
{
EditorPrefs.SetBool(MenuItemName, value);
EditorApplication.delayCall += () => Menu.SetChecked(MenuItemName, value);
}
}
[MenuItem(MenuItemName)]
public static void ToggleEnabled()
{
Enabled = !Enabled;
}
[MenuItem(MenuItemName, validate = true)]
public static bool ValidateEnabled()
{
Menu.SetChecked(MenuItemName, Enabled);
return true;
}
Ghat-Smith
Dec 11, 2017 12:36
Hello. After struggling with a similar problem (checkboxes lost after script compilation), it seems that I found a solution. You can call SetChecked in the MenuItem validation method. See documentation (https://docs.unity3d.com/ScriptReference/MenuItem.html) for more details about MenuItem validation implementation.
neilmillstone
Dec 15, 2016 17:43
This is still an issue, since Menus cannot be checked during the game, we're left with checkboxes that always look unchecked in play mode. This makes people confused.
Even calling Menu.SetChecked(MENU_NAME, true) every frame doesn't cause a check mark to appear during play mode.