public void Initialize(DebugLogManager manager, List <DebugLogEntry> collapsedLogEntries,
                        DebugLogIndexList indicesOfEntriesToShow, float logItemHeight)
 {
     this.manager                = manager;
     this.collapsedLogEntries    = collapsedLogEntries;
     this.indicesOfEntriesToShow = indicesOfEntriesToShow;
     this.logItemHeight          = logItemHeight;
     _1OverLogItemHeight         = 1f / logItemHeight;
 }
    void OnEnable()
    {
        // Only one instance of debug console is allowed
        if (instance == null)
        {
            instance       = this;
            pooledLogItems = new List <DebugLogItem>();

            canvasTR = (RectTransform)transform;

            // Associate sprites with log types
            logSpriteRepresentations = new Dictionary <LogType, Sprite>
            {
                { LogType.Log, infoLog },
                { LogType.Warning, warningLog },
                { LogType.Error, errorLog },
                { LogType.Exception, errorLog },
                { LogType.Assert, errorLog }
            };

            inputCommandHistory = new LinkedList <string>();

            // Initially, all log types are visible
            filterInfoButton.color    = buttonSelectedColor;
            filterWarningButton.color = buttonSelectedColor;
            filterErrorButton.color   = buttonSelectedColor;

            collapsedLogEntries          = new List <DebugLogEntry>(128);
            collapsedLogEntriesMap       = new Dictionary <DebugLogEntry, int>(128);
            uncollapsedLogEntriesIndices = new DebugLogIndexList();
            indicesOfListEntriesToShow   = new DebugLogIndexList();

            recycledListView.Initialize(this, collapsedLogEntries, indicesOfListEntriesToShow, logItemPrefab.Transform.sizeDelta.y);
            recycledListView.UpdateItemsInTheList(true);

            nullPointerEventData = new PointerEventData(null);

            //enumerate buttons
            SetupDebugButtons();

            // If it is a singleton object, don't destroy it between scene changes
            if (singleton)
            {
                DontDestroyOnLoad(gameObject);
            }
        }
        else if (this != instance)
        {
            Destroy(gameObject);
            return;
        }

        // Intercept debug entries
        Application.logMessageReceived -= ReceivedLog;
        Application.logMessageReceived += ReceivedLog;

        if (receiveLogcatLogsInAndroid)
        {
#if !UNITY_EDITOR && UNITY_ANDROID
            if (logcatListener == null)
            {
                logcatListener = new DebugLogLogcatListener();
            }

            logcatListener.Start(logcatArguments);
#endif
        }

        // Listen for entered commands
        commandInputField.onValidateInput -= OnValidateCommand;
        commandInputField.onValidateInput += OnValidateCommand;

        if (minimumHeight < 120f)
        {
            minimumHeight = 120f;
        }
    }