Пример #1
0
 //재귀적으로 Hierarchy 레이아웃을 출력
 //Child에 진입할때마다 Level을 높인다. (여백과 Fold의 기준이 됨)
 private void GUI_RenderUnit(apEditorHierarchyUnit unit, int level, int width, float scrollX, bool isGUIEvent)
 {
     unit.GUI_Render(level * 10, width, 20, scrollX, isGUIEvent);
     //if (unit._isFoldOut)
     if (unit.IsFoldOut)
     {
         if (unit._childUnits.Count > 0)
         {
             for (int i = 0; i < unit._childUnits.Count; i++)
             {
                 //재귀적으로 호출
                 GUI_RenderUnit(unit._childUnits[i], level + 1, width, scrollX, isGUIEvent);
             }
         }
     }
 }
        //재귀적으로 Hierarchy 레이아웃을 출력
        //Child에 진입할때마다 Level을 높인다. (여백과 Fold의 기준이 됨)
        private void GUI_RenderUnit(apEditorHierarchyUnit unit, int level, int width, Vector2 scroll, int scrollLayoutHeight, bool isGUIEvent, bool isOrderChanged)
        {
            unit.GUI_Render(_curUnitPosY, level * 10, width, 20, scroll, scrollLayoutHeight, isGUIEvent, level, isOrderChanged);

            _curUnitPosY += 20;            //Height만큼 증가

            if (unit.IsFoldOut)
            {
                if (unit._childUnits.Count > 0)
                {
                    for (int i = 0; i < unit._childUnits.Count; i++)
                    {
                        //재귀적으로 호출
                        GUI_RenderUnit(unit._childUnits[i], level + 1, width, scroll, scrollLayoutHeight, isGUIEvent, isOrderChanged);
                    }
                }
            }
        }