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));
         }
     }
 }