ExtractMenuItemWithPath() public static method

public static ExtractMenuItemWithPath ( string menuString, GenericMenu menu, string replacementMenuString, Object temporaryContext, int userData, Action onBeforeExecuteCallback, Action onAfterExecuteCallback ) : void
menuString string
menu GenericMenu
replacementMenuString string
temporaryContext Object
userData int
onBeforeExecuteCallback Action
onAfterExecuteCallback Action
return void
 private void AddCreateGameObjectItemsToMenu(GenericMenu menu, UnityEngine.Object[] context, bool includeCreateEmptyChild, bool includeGameObjectInPath, int targetSceneHandle)
 {
     string[] submenus = Unsupported.GetSubmenus("GameObject");
     string[] array    = submenus;
     for (int i = 0; i < array.Length; i++)
     {
         string text = array[i];
         UnityEngine.Object[] temporaryContext = context;
         if (includeCreateEmptyChild || !(text.ToLower() == "GameObject/Create Empty Child".ToLower()))
         {
             if (text.EndsWith("..."))
             {
                 temporaryContext = null;
             }
             if (text.ToLower() == "GameObject/Center On Children".ToLower())
             {
                 return;
             }
             string replacementMenuString = text;
             if (!includeGameObjectInPath)
             {
                 replacementMenuString = text.Substring(11);
             }
             MenuUtils.ExtractMenuItemWithPath(text, menu, replacementMenuString, temporaryContext, targetSceneHandle, new Action <string, UnityEngine.Object[], int>(this.BeforeCreateGameObjectMenuItemWasExecuted), new Action <string, UnityEngine.Object[], int>(this.AfterCreateGameObjectMenuItemWasExecuted));
         }
     }
 }
示例#2
0
        public static void ExtractSubMenuWithPath(string path, GenericMenu menu, string replacementPath, UnityEngine.Object[] temporaryContext)
        {
            HashSet <string> stringSet = new HashSet <string>((IEnumerable <string>)Unsupported.GetSubmenus(path));

            foreach (string includingSeparator in Unsupported.GetSubmenusIncludingSeparators(path))
            {
                string replacementMenuString = replacementPath + includingSeparator.Substring(path.Length);
                if (stringSet.Contains(includingSeparator))
                {
                    MenuUtils.ExtractMenuItemWithPath(includingSeparator, menu, replacementMenuString, temporaryContext, -1, (System.Action <string, UnityEngine.Object[], int>)null, (System.Action <string, UnityEngine.Object[], int>)null);
                }
            }
        }
示例#3
0
        public static void ExtractSubMenuWithPath(string path, GenericMenu menu, string replacementPath, UnityEngine.Object[] temporaryContext)
        {
            HashSet <string> hashSet = new HashSet <string>(Unsupported.GetSubmenus(path));

            string[] submenusIncludingSeparators = Unsupported.GetSubmenusIncludingSeparators(path);
            for (int i = 0; i < submenusIncludingSeparators.Length; i++)
            {
                string text = submenusIncludingSeparators[i];
                string replacementMenuString = replacementPath + text.Substring(path.Length);
                if (hashSet.Contains(text))
                {
                    MenuUtils.ExtractMenuItemWithPath(text, menu, replacementMenuString, temporaryContext, -1, null, null);
                }
            }
        }
示例#4
0
 private void AddCreateGameObjectItemsToMenu(GenericMenu menu, UnityEngine.Object[] context, bool includeCreateEmptyChild)
 {
     foreach (string str in Unsupported.GetSubmenus("GameObject"))
     {
         UnityEngine.Object[] temporaryContext = context;
         if (includeCreateEmptyChild || (str.ToLower() != "GameObject/Create Empty Child".ToLower()))
         {
             if (str.EndsWith("..."))
             {
                 temporaryContext = null;
             }
             if (str.ToLower() == "GameObject/Center On Children".ToLower())
             {
                 return;
             }
             MenuUtils.ExtractMenuItemWithPath(str, menu, str.Substring(11), temporaryContext);
         }
     }
 }
示例#5
0
 private void AddCreateGameObjectItemsToMenu(GenericMenu menu, UnityEngine.Object[] context, bool includeCreateEmptyChild)
 {
     string[] submenus = Unsupported.GetSubmenus("GameObject");
     string[] array    = submenus;
     for (int i = 0; i < array.Length; i++)
     {
         string text = array[i];
         UnityEngine.Object[] temporaryContext = context;
         if (includeCreateEmptyChild || !(text.ToLower() == "GameObject/Create Empty Child".ToLower()))
         {
             if (text.EndsWith("..."))
             {
                 temporaryContext = null;
             }
             if (text.ToLower() == "GameObject/Center On Children".ToLower())
             {
                 return;
             }
             MenuUtils.ExtractMenuItemWithPath(text, menu, text.Substring(11), temporaryContext);
         }
     }
 }
 private void AddCreateGameObjectItemsToMenu(GenericMenu menu, Object[] context, bool includeCreateEmptyChild, bool includeGameObjectInPath, int targetSceneHandle)
 {
     foreach (string str in Unsupported.GetSubmenus("GameObject"))
     {
         Object[] temporaryContext = context;
         if (includeCreateEmptyChild || (str.ToLower() != "GameObject/Create Empty Child".ToLower()))
         {
             if (str.EndsWith("..."))
             {
                 temporaryContext = null;
             }
             if (str.ToLower() == "GameObject/Center On Children".ToLower())
             {
                 return;
             }
             string replacementMenuString = str;
             if (!includeGameObjectInPath)
             {
                 replacementMenuString = str.Substring(11);
             }
             MenuUtils.ExtractMenuItemWithPath(str, menu, replacementMenuString, temporaryContext, targetSceneHandle, new Action <string, Object[], int>(this.BeforeCreateGameObjectMenuItemWasExecuted), new Action <string, Object[], int>(this.AfterCreateGameObjectMenuItemWasExecuted));
         }
     }
 }