private apEditorHierarchyUnit AddUnit_OnlyButton(Texture2D icon, string text, CATEGORY savedKey, object savedObj, bool isRoot, apEditorHierarchyUnit parent)
        {
            apEditorHierarchyUnit newUnit = new apEditorHierarchyUnit();

            //newUnit.SetBasicIconImg(Editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_FoldDown),
            //							Editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_FoldRight),
            //							Editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_Registered));

            //19.11.16
            newUnit.SetBasicIconImg(_guiContent_FoldDown,
                                    _guiContent_FoldRight,
                                    _guiContent_ModRegisted);


            newUnit.SetEvent(OnUnitClick);
            newUnit.SetOnlyButton(icon, text, (int)savedKey, savedObj);

            _units_All.Add(newUnit);
            if (isRoot)
            {
                _units_Root.Add(newUnit);
            }

            if (parent != null)
            {
                newUnit.SetParent(parent);
                parent.AddChild(newUnit);
            }
            return(newUnit);
        }
        private apEditorHierarchyUnit AddUnit_ToggleButton(Texture2D icon, string text, CATEGORY savedKey, object savedObj, bool isRoot, apEditorHierarchyUnit parent, bool isOrderChangable = true)
        {
            apEditorHierarchyUnit newUnit = new apEditorHierarchyUnit();

            //newUnit.SetBasicIconImg(Editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_FoldDown),
            //							Editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_FoldRight),
            //							Editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_Registered),
            //							Editor.ImageSet.Get(apImageSet.PRESET.Modifier_LayerUp),
            //							Editor.ImageSet.Get(apImageSet.PRESET.Modifier_LayerDown)
            //							);

            //19.11.16
            newUnit.SetBasicIconImg(_guiContent_FoldDown,
                                    _guiContent_FoldRight,
                                    _guiContent_ModRegisted,
                                    _guiContent_OrderUp,
                                    _guiContent_OrderDown
                                    );


            if (isOrderChangable)
            {
                newUnit.SetEvent(OnUnitClick, null, OnUnitClickOrderChanged);
            }
            else
            {
                newUnit.SetEvent(OnUnitClick);
            }


            newUnit.SetToggleButton(icon, text, (int)savedKey, savedObj);

            _units_All.Add(newUnit);
            if (isRoot)
            {
                _units_Root.Add(newUnit);
            }

            if (parent != null)
            {
                newUnit.SetParent(parent);
                parent.AddChild(newUnit);
            }
            return(newUnit);
        }