Exemplo n.º 1
0
        public static void PrefabHierachyOptions(PrefabHierarchyTreeView treeView, ref string name, ref bool replace)
        {
            Elements.MiniBoldLabel(ToolTips.hierachyOptionsLabel);

            Elements.BeginToolbarHorizontal();
            name = Elements.ToolbarTextField(name);
            Elements.EndToolbarHorizontal();

            Elements.BeginToolbarHorizontal();
            if (Elements.ToolbarButton(ToolTips.hierachyCategoryRename))
            {
                name = String.IsNullOrEmpty(name) ? "" : name;
                PrefabManager.RenamePrefabCategories(PrefabHierarchyTreeView.PrefabDataFromSelection(treeView), name);
                ReloadTreeViews();
            }
            Elements.EndToolbarHorizontal();

            Elements.BeginToolbarHorizontal();
            replace = Elements.ToolbarToggle(ToolTips.hierachyReplace, replace);
            if (Elements.ToolbarButton(ToolTips.hierachyIDRename))
            {
                if (uint.TryParse(name, out uint result))
                {
                    PrefabManager.RenamePrefabIDs(PrefabHierarchyTreeView.PrefabDataFromSelection(treeView), result, replace);
                    ReloadTreeViews();
                }
            }
            Elements.EndToolbarHorizontal();

            Elements.BeginToolbarHorizontal();
            if (Elements.ToolbarButton(ToolTips.hierachyDelete))
            {
                PrefabManager.DeletePrefabs(PrefabHierarchyTreeView.PrefabDataFromSelection(treeView));
            }
            Elements.EndToolbarHorizontal();
        }
Exemplo n.º 2
0
 void DrawOptions(Rect rect)
 {
     GUILayout.BeginArea(rect);
     Functions.HierachyOptions(PrefabHierarchyTreeView.PrefabDataFromSelection(treeView).ToArray(), ref category);
     GUILayout.EndArea();
 }