Esempio n. 1
0
        private void SetText(DebugLogEntry logEntry, DebugLogEntryTimestamp?logEntryTimestamp, bool isExpanded)
        {
            if (!logEntryTimestamp.HasValue || (!isExpanded && !listView.manager.alwaysDisplayTimestamps))
            {
                logText.text = isExpanded ? logEntry.ToString() : logEntry.logString;
            }
            else
            {
                StringBuilder sb = listView.manager.sharedStringBuilder;
                sb.Length = 0;

                if (isExpanded)
                {
                    logEntryTimestamp.Value.AppendFullTimestamp(sb);
                    sb.Append(": ").Append(logEntry.ToString());
                }
                else
                {
                    logEntryTimestamp.Value.AppendTime(sb);
                    sb.Append(" ").Append(logEntry.logString);
                }

                logText.text = sb.ToString();
            }
        }
Esempio n. 2
0
        public void SetContent(DebugLogEntry logEntry, int entryIndex, bool isExpanded)
        {
            this.logEntry   = logEntry;
            this.entryIndex = entryIndex;

            Vector2 size = transformComponent.sizeDelta;

            if (isExpanded)
            {
                logText.horizontalOverflow = HorizontalWrapMode.Wrap;
                size.y = manager.SelectedItemHeight;
                //logText.rectTransform.anchoredPosition = logTextOriginalPosition;
                //logText.rectTransform.sizeDelta = logTextOriginalSize;
            }
            else
            {
                logText.horizontalOverflow = HorizontalWrapMode.Overflow;
                size.y = manager.ItemHeight;
                //logText.rectTransform.anchoredPosition = logTextOriginalPosition;
                //logText.rectTransform.sizeDelta = logTextOriginalSize;
            }
            transformComponent.sizeDelta = size;

            logText.text        = isExpanded ? logEntry.ToString() : logEntry.logString;
            logTypeImage.sprite = logEntry.logTypeSpriteRepresentation;
        }
Esempio n. 3
0
        public void CopyLog()
        {
            string log = logEntry.ToString();

            if (string.IsNullOrEmpty(log))
            {
                return;
            }

#if UNITY_EDITOR || UNITY_2018_1_OR_NEWER || (!UNITY_ANDROID && !UNITY_IOS)
            GUIUtility.systemCopyBuffer = log;
#elif UNITY_ANDROID
            AJC.CallStatic("CopyText", Context, log);
#elif UNITY_IOS
            _DebugConsole_CopyText(log);
#endif
        }
Esempio n. 4
0
        internal string GetCopyContent()
        {
            if (!logEntryTimestamp.HasValue)
            {
                return(logEntry.ToString());
            }
            else
            {
                StringBuilder sb = listView.manager.sharedStringBuilder;
                sb.Length = 0;

                logEntryTimestamp.Value.AppendFullTimestamp(sb);
                sb.Append(": ").Append(logEntry.ToString());

                return(sb.ToString());
            }
        }
Esempio n. 5
0
        public void SetContent(DebugLogEntry logEntry, int entryIndex, bool isExpanded)
        {
            this.logEntry   = logEntry;
            this.entryIndex = entryIndex;

            Vector2 size = transformComponent.sizeDelta;

            if (isExpanded)
            {
                logText.horizontalOverflow = HorizontalWrapMode.Wrap;
                size.y = manager.SelectedItemHeight;

                if (!copyLogButton.gameObject.activeSelf)
                {
                    copyLogButton.gameObject.SetActive(true);

                    logText.rectTransform.anchoredPosition = new Vector2(logTextOriginalPosition.x, logTextOriginalPosition.y + copyLogButtonHeight * 0.5f);
                    logText.rectTransform.sizeDelta        = logTextOriginalSize - new Vector2(0f, copyLogButtonHeight);
                }
            }
            else
            {
                logText.horizontalOverflow = HorizontalWrapMode.Overflow;
                size.y = manager.ItemHeight;

                if (copyLogButton.gameObject.activeSelf)
                {
                    copyLogButton.gameObject.SetActive(false);

                    logText.rectTransform.anchoredPosition = logTextOriginalPosition;
                    logText.rectTransform.sizeDelta        = logTextOriginalSize;
                }
            }
            transformComponent.sizeDelta = size;

            logText.text        = isExpanded ? logEntry.ToString() : logEntry.logString;
            DebuMessage         = isExpanded ? logEntry.ToString() : logEntry.logString;
            logTypeImage.sprite = logEntry.logTypeSpriteRepresentation;
            DebugDisplay.OnDebugMessageDisplayed?.Invoke(DebuMessage, logEntry.logTypeSpriteRepresentation);
        }
        public void SetContent(DebugLogEntry logEntry, int entryIndex, bool isExpanded)
        {
            this.logEntry   = logEntry;
            this.entryIndex = entryIndex;

            Vector2 size = transformComponent.sizeDelta;

            if (isExpanded)
            {
                //logText.horizontalOverflow = HorizontalWrapMode.Wrap;
                size.y = manager.SelectedItemHeight;
            }
            else
            {
                //logText.horizontalOverflow = HorizontalWrapMode.Wrap;
                //size.y = CalculateExpandedHeight(logEntry.logString);
                size.y = manager.ItemHeight;
            }
            transformComponent.sizeDelta = size;

            logText.text        = isExpanded ? logEntry.ToString() : logEntry.logString;
            logTypeImage.sprite = logEntry.logTypeSpriteRepresentation;
        }
        public void SetContent(DebugLogEntry logEntry, int entryIndex, bool isExpanded)
        {
            this.logEntry = logEntry;
            Index         = entryIndex;

            var size = Transform.sizeDelta;

            if (isExpanded)
            {
                logText.horizontalOverflow = HorizontalWrapMode.Wrap;
                size.y = manager.SelectedItemHeight;
            }
            else
            {
                logText.horizontalOverflow = HorizontalWrapMode.Overflow;
                size.y = manager.ItemHeight;
            }

            Transform.sizeDelta = size;

            logText.text        = isExpanded ? logEntry.ToString() : logEntry.logString;
            logTypeImage.sprite = logEntry.logTypeSpriteRepresentation;
        }
 // Return a string containing complete information about the debug entry
 public override string ToString()
 {
     return(logEntry.ToString());
 }