private void FillPool() { for (int i = 0; i < m_logViewHistoryMax + 1; i++) { ObeliskLog log = Instantiate(m_obeliskLogPrefab); log.transform.SetParent(m_obeliskLogPoolContainer, false); m_obeliskLogPool.Enqueue(log); } }
private void AddLogViewHistory(ObeliskLog obeliskLog) { if (m_logViewHistory.Count >= m_logViewHistoryMax) { PoolLog(m_logViewHistory[0]); m_logViewHistory.RemoveAt(0); } m_logViewHistory.Add(obeliskLog); ResizeLogLayout(); }
protected override void OnConsoleLogHistoryChanged() { base.OnConsoleLogHistoryChanged(); ObeliskLog obeliskLog = m_obeliskLogPool.Dequeue(); obeliskLog.transform.SetParent(m_logLayout, false); ConsoleLog consoleLog = Console.consoleHistory.LogGetLatest(); obeliskLog.SetLog(ref consoleLog); AddLogViewHistory(obeliskLog); }
private void PoolLog(ObeliskLog obeliskLog) { obeliskLog.transform.SetParent(m_obeliskLogPoolContainer, false); m_obeliskLogPool.Enqueue(obeliskLog); }