Change a menu's "Appear type" at runtime

This custom Action allows you to change a menu's "Appear type" property at runtime. To use it, place the code below in a C# script named ActionChangeMenuAppearType.cs, and place the file in your custom Actions folder. For more on custom Actions and such folders, see this tutorial.

ActionChangeMenuAppearType.cs using UnityEngine; using System.Collections; using UnityEditor; namespace AC { public class ActionChangeMenuAppearType : Action { 		public string menuName; public AppearType newAppearType; public ActionChangeMenuAppearType { 			this.isDisplayed = true; category = ActionCategory.Menu; title = "Change appear type"; } 		override public float Run { 			Menu menu = AC.PlayerMenus.GetMenuWithName (menuName); if (menu != null) { 				menu.appearType = newAppearType; } 			return 0f; } 		#if UNITY_EDITOR override public void ShowGUI { 			menuName = EditorGUILayout.TextField ("Menu name:", menuName); newAppearType = (AppearType) EditorGUILayout.EnumPopup ("New appear type:", newAppearType); AfterRunningOption ; } 		#endif } }
 * 1) if UNITY_EDITOR
 * 1) endif