Skip to content

Commit ea7a1b2

Browse files
committed
Tiny simplifications in the codebase
1 parent 192208b commit ea7a1b2

7 files changed

Lines changed: 4 additions & 25 deletions

File tree

Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
#if UNITY_EDITOR || UNITY_STANDALONE
2-
// Unity's Text component doesn't render <b> tag correctly on mobile devices
3-
#define USE_BOLD_COMMAND_SIGNATURES
4-
#endif
5-
6-
using UnityEngine;
1+
using UnityEngine;
72
using System;
83
using System.Collections;
94
using System.Collections.Generic;
105
using System.Globalization;
116
using System.Reflection;
127
using System.Text;
138
using Object = UnityEngine.Object;
14-
#if UNITY_EDITOR && UNITY_2021_1_OR_NEWER
9+
#if UNITY_EDITOR
1510
using SystemInfo = UnityEngine.Device.SystemInfo; // To support Device Simulator on Unity 2021.1+
1611
#endif
1712

@@ -527,9 +522,7 @@ internal static void AddCommand( string command, string description, MethodInfo
527522
StringBuilder methodSignature = new StringBuilder( 256 );
528523
string[] parameterSignatures = new string[parameterTypes.Length];
529524

530-
#if USE_BOLD_COMMAND_SIGNATURES
531525
methodSignature.Append( "<b>" );
532-
#endif
533526
methodSignature.Append( command );
534527

535528
if( parameterTypes.Length > 0 )
@@ -549,9 +542,7 @@ internal static void AddCommand( string command, string description, MethodInfo
549542
}
550543
}
551544

552-
#if USE_BOLD_COMMAND_SIGNATURES
553545
methodSignature.Append( "</b>" );
554-
#endif
555546

556547
if( !string.IsNullOrEmpty( description ) )
557548
methodSignature.Append( ": " ).Append( description );

Plugins/IngameDebugConsole/Scripts/DebugLogItem.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace IngameDebugConsole
1313
{
1414
public class DebugLogItem : MonoBehaviour, IPointerClickHandler
1515
{
16-
#pragma warning disable 0649
1716
// Cached components
1817
[SerializeField]
1918
private RectTransform transformComponent;
@@ -40,7 +39,6 @@ public class DebugLogItem : MonoBehaviour, IPointerClickHandler
4039

4140
[SerializeField]
4241
private Button copyLogButton;
43-
#pragma warning restore 0649
4442

4543
// Debug entry to show with this log item
4644
private DebugLogEntry logEntry;

Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
1010
using UnityEngine.InputSystem;
1111
#endif
12-
#if UNITY_EDITOR && UNITY_2021_1_OR_NEWER
12+
#if UNITY_EDITOR
1313
using Screen = UnityEngine.Device.Screen; // To support Device Simulator on Unity 2021.1+
1414
#endif
1515

@@ -47,7 +47,6 @@ public class DebugLogManager : MonoBehaviour
4747
{
4848
public static DebugLogManager Instance { get; private set; }
4949

50-
#pragma warning disable 0649
5150
[Header( "Properties" )]
5251
[SerializeField]
5352
[HideInInspector]
@@ -325,7 +324,6 @@ public class DebugLogManager : MonoBehaviour
325324
// Recycled list view to handle the log items efficiently
326325
[SerializeField]
327326
private DebugLogRecycledListView recycledListView;
328-
#pragma warning restore 0649
329327

330328
private bool isLogWindowVisible = true;
331329
public bool IsLogWindowVisible { get { return isLogWindowVisible; } }

Plugins/IngameDebugConsole/Scripts/DebugLogPopup.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using UnityEngine.EventSystems;
44
using System.Collections;
55
using TMPro;
6-
#if UNITY_EDITOR && UNITY_2021_1_OR_NEWER
6+
#if UNITY_EDITOR
77
using Screen = UnityEngine.Device.Screen; // To support Device Simulator on Unity 2021.1+
88
#endif
99

@@ -23,7 +23,6 @@ public class DebugLogPopup : MonoBehaviour, IPointerClickHandler, IBeginDragHand
2323
// Canvas group to modify visibility of the popup
2424
private CanvasGroup canvasGroup;
2525

26-
#pragma warning disable 0649
2726
[SerializeField]
2827
private DebugLogManager debugManager;
2928

@@ -40,7 +39,6 @@ public class DebugLogPopup : MonoBehaviour, IPointerClickHandler, IBeginDragHand
4039
private Color alertColorWarning;
4140
[SerializeField]
4241
private Color alertColorError;
43-
#pragma warning restore 0649
4442

4543
// Number of new debug entries since the log window has been closed
4644
private int newInfoCount = 0, newWarningCount = 0, newErrorCount = 0;

Plugins/IngameDebugConsole/Scripts/DebugLogRecycledListView.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace IngameDebugConsole
88
{
99
public class DebugLogRecycledListView : MonoBehaviour
1010
{
11-
#pragma warning disable 0649
1211
// Cached components
1312
[SerializeField]
1413
private RectTransform transformComponent;
@@ -21,7 +20,6 @@ public class DebugLogRecycledListView : MonoBehaviour
2120
private Color logItemNormalColor2;
2221
[SerializeField]
2322
private Color logItemSelectedColor;
24-
#pragma warning restore 0649
2523

2624
internal DebugLogManager manager;
2725
private ScrollRect scrollView;

Plugins/IngameDebugConsole/Scripts/DebugLogResizeListener.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ namespace IngameDebugConsole
66
{
77
public class DebugLogResizeListener : MonoBehaviour, IBeginDragHandler, IDragHandler
88
{
9-
#pragma warning disable 0649
109
[SerializeField]
1110
private DebugLogManager debugManager;
12-
#pragma warning restore 0649
1311

1412
// This interface must be implemented in order to receive drag events
1513
void IBeginDragHandler.OnBeginDrag( PointerEventData eventData )

Plugins/IngameDebugConsole/Scripts/EventSystemHandler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ namespace IngameDebugConsole
1111
[DefaultExecutionOrder( 1000 )]
1212
public class EventSystemHandler : MonoBehaviour
1313
{
14-
#pragma warning disable 0649
1514
[SerializeField]
1615
private GameObject embeddedEventSystem;
17-
#pragma warning restore 0649
1816

1917
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
2018
private void Awake()

0 commit comments

Comments
 (0)