void InitConsole() { m_ConsoleCommandScrollRect = transform.Find("Command").GetComponent <ScrollRect>(); m_CommandContainers = new TGameObjectPool_Instance_Class <int, CommandContainer>(m_ConsoleCommandScrollRect.transform.Find("Viewport/Content"), "GridItem"); Transform containerItemPool = m_ConsoleCommandScrollRect.transform.Find("Viewport/CommandItemPool"); UReflection.TraversalAllInheritedClasses <CommandItemBase>(type => m_CommandItems.Add(type, new TGameObjectPool_Instance_Class <int, CommandItemBase>(containerItemPool, type, type.Name))); m_ConsoleOpening = false; m_ConsoleCommandScrollRect.SetActive(m_ConsoleOpening); m_PageSelection = new TGameObjectPool_Instance_Class <int, ButtonSelect>(m_ConsoleCommandScrollRect.transform.Find("Viewport/Content/PageSelect"), "GridItem"); }
void InitLog() { m_LogPanelRect = transform.Find("LogPanel").GetComponent <ScrollRect>(); Transform rightContent = m_LogPanelRect.transform.Find("Viewport/Content"); m_LogFilter = rightContent.Find("LogFilter") as RectTransform; m_FilterLog = new LogToggle(m_LogFilter.Find("Log"), m_Data.m_Log, OnLogToggled); m_FilterWarning = new LogToggle(m_LogFilter.Find("Warning"), m_Data.m_Warning, OnLogToggled); m_FilterError = new LogToggle(m_LogFilter.Find("Error"), m_Data.m_Error, OnLogToggled); m_FilterCollapse = new LogToggle(m_LogFilter.Find("Collapse"), m_Data.m_Collapse, OnLogToggled); m_Logs = new TGameObjectPool_Instance_Class <int, LogItem>(m_LogPanelRect.transform.Find("Viewport/Content"), "LogItem"); m_Stack = new StackPanel(transform.Find("Stack")); m_LogFilter.Find("Clear").GetComponent <Button>().onClick.AddListener(ClearConsoleLog); }
public CommandItem_ButtonSelection(Transform _transform) : base(_transform) { m_ButtonGrid = new TGameObjectPool_Instance_Class <int, ButtonSelect>(_transform, "GridItem"); }