移除不用的脚本
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
using SRF;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
using UnityEngine.Profiling;
|
||||
#endif
|
||||
|
||||
public class ProfilerMemoryBlock : SRMonoBehaviourEx
|
||||
{
|
||||
@@ -41,13 +39,8 @@
|
||||
long max;
|
||||
long current;
|
||||
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
max = Profiler.GetTotalReservedMemoryLong();
|
||||
current = Profiler.GetTotalAllocatedMemoryLong();
|
||||
#else
|
||||
max = Profiler.GetTotalReservedMemory();
|
||||
current = Profiler.GetTotalAllocatedMemory();
|
||||
#endif
|
||||
|
||||
var maxMb = (max >> 10);
|
||||
maxMb /= 1024; // On new line to fix il2cpp
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
using SRF;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
using UnityEngine.Profiling;
|
||||
#endif
|
||||
|
||||
public class ProfilerMonoBlock : SRMonoBehaviourEx
|
||||
{
|
||||
@@ -29,11 +27,7 @@
|
||||
{
|
||||
base.OnEnable();
|
||||
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
_isSupported = Profiler.GetMonoUsedSizeLong() > 0;
|
||||
#else
|
||||
_isSupported = Profiler.GetMonoUsedSize() > 0;
|
||||
#endif
|
||||
|
||||
NotSupportedMessage.SetActive(!_isSupported);
|
||||
CurrentUsedText.gameObject.SetActive(_isSupported);
|
||||
@@ -57,13 +51,8 @@
|
||||
long max;
|
||||
long current;
|
||||
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
max = _isSupported ? Profiler.GetMonoHeapSizeLong() : GC.GetTotalMemory(false);
|
||||
current = Profiler.GetMonoUsedSizeLong();
|
||||
#else
|
||||
max = _isSupported ? Profiler.GetMonoHeapSize() : GC.GetTotalMemory(false);
|
||||
current = Profiler.GetMonoUsedSize();
|
||||
#endif
|
||||
|
||||
var maxMb = (max >> 10);
|
||||
maxMb /= 1024; // On new line to workaround IL2CPP bug
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
using SRF;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
using UnityEngine.Profiling;
|
||||
#endif
|
||||
|
||||
public class ProfilerEnableControl : SRMonoBehaviourEx
|
||||
{
|
||||
|
||||
@@ -81,6 +81,15 @@ namespace SRDebugger.UI.Other
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenPrivacyPolicy()
|
||||
{
|
||||
var s = SRServiceManager.GetService<IBugReportService>();
|
||||
if (s != null && !string.IsNullOrWhiteSpace(s.PrivacyPolicyUrl))
|
||||
{
|
||||
Application.OpenURL(s.PrivacyPolicyUrl);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator SubmitCo()
|
||||
{
|
||||
if (BugReportScreenshotUtil.ScreenshotData == null && Settings.Instance.EnableBugReportScreenshot)
|
||||
|
||||
@@ -111,17 +111,20 @@ namespace SRDebugger.UI.Tabs
|
||||
FilterToggle.onValueChanged.AddListener(FilterToggleValueChanged);
|
||||
FilterBarContainer.SetActive(FilterToggle.isOn);
|
||||
|
||||
#if UNITY_5_3_OR_NEWER
|
||||
ConsoleLogControl.Filter = FilterState.TextFilter;
|
||||
|
||||
FilterToggle.isOn = !string.IsNullOrWhiteSpace(FilterState.TextFilter);
|
||||
|
||||
FilterField.text = FilterState.TextFilter;
|
||||
FilterField.onValueChanged.AddListener(FilterValueChanged);
|
||||
#else
|
||||
FilterField.onValueChange.AddListener(FilterValueChanged);
|
||||
#endif
|
||||
|
||||
ConsoleLogControl.SelectedItemChanged = ConsoleLogSelectedItemChanged;
|
||||
|
||||
Service.Console.Updated += ConsoleOnUpdated;
|
||||
Service.Panel.VisibilityChanged += PanelOnVisibilityChanged;
|
||||
|
||||
FilterState.FilterStateChange += OnFilterStateChange;
|
||||
FilterState.TextFilterChange += OnTextFilterChange;
|
||||
|
||||
StackTraceText.supportRichText = Settings.Instance.RichTextInConsole;
|
||||
PopulateStackTraceArea(null);
|
||||
@@ -144,7 +147,16 @@ namespace SRDebugger.UI.Tabs
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnTextFilterChange(string newFilter)
|
||||
{
|
||||
FilterField.text = newFilter;
|
||||
if (!string.IsNullOrWhiteSpace(newFilter))
|
||||
{
|
||||
FilterToggle.isOn = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void FilterToggleValueChanged(bool isOn)
|
||||
{
|
||||
if (isOn)
|
||||
@@ -163,10 +175,12 @@ namespace SRDebugger.UI.Tabs
|
||||
if (FilterToggle.isOn && !string.IsNullOrEmpty(filterText) && filterText.Trim().Length != 0)
|
||||
{
|
||||
ConsoleLogControl.Filter = filterText;
|
||||
FilterState.TextFilter = filterText;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleLogControl.Filter = null;
|
||||
FilterState.TextFilter = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,8 +217,8 @@ namespace SRDebugger.UI.Tabs
|
||||
}
|
||||
|
||||
FilterState.FilterStateChange -= OnFilterStateChange;
|
||||
FilterState.TextFilterChange -= OnTextFilterChange;
|
||||
|
||||
|
||||
base.OnDestroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace SRDebugger.UI.Tabs
|
||||
new Dictionary<OptionDefinition, OptionsControlBase>();
|
||||
|
||||
private bool _queueRefresh;
|
||||
private bool _queuePopulate;
|
||||
private bool _selectionModeEnabled;
|
||||
private Canvas _optionCanvas;
|
||||
|
||||
@@ -95,7 +96,7 @@ namespace SRDebugger.UI.Tabs
|
||||
private void OnOptionsUpdated(object sender, EventArgs eventArgs)
|
||||
{
|
||||
Clear();
|
||||
Populate();
|
||||
_queuePopulate = true;
|
||||
}
|
||||
|
||||
protected override void OnEnable()
|
||||
@@ -129,6 +130,16 @@ namespace SRDebugger.UI.Tabs
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (_queuePopulate)
|
||||
{
|
||||
_queuePopulate = false;
|
||||
Clear();
|
||||
Populate();
|
||||
}
|
||||
}
|
||||
|
||||
private void PanelOnVisibilityChanged(IDebugPanelService debugPanelService, bool b)
|
||||
{
|
||||
// Always end pinning mode when panel is closed
|
||||
|
||||
Reference in New Issue
Block a user