private static void SetValue(RadioMenuAttribute radioMenu, bool enabled) { // Set checkmark on menu item Menu.SetChecked(radioMenu.Path, enabled); // Saving editor state EditorPrefs.SetBool(radioMenu.Path, enabled); radioMenu.Enabled = enabled; }
public static void PerformAction(RadioMenuAttribute radioMenu, bool changeOpt = true) { var enabled = EditorPrefs.GetBool(radioMenu.Path); if (changeOpt) { enabled = !enabled; } // Reset values var hashset = RadioMenuAttribute.GetAttributes(radioMenu.Path); foreach (var attr in hashset) { SetValue(attr, false); } SetValue(radioMenu, enabled); }
public static void PerformAction(string path) { var attr = RadioMenuAttribute.GetAttributeFromPath(path); PerformAction(attr); }