移除不用的脚本
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SRDebugger.Editor
|
||||
@@ -16,8 +17,10 @@ namespace SRDebugger.Editor
|
||||
{
|
||||
foreach (BuildTargetGroup targetGroup in GetAllBuildTargetGroups())
|
||||
{
|
||||
var namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(targetGroup);
|
||||
|
||||
// Use hash set to remove duplicates.
|
||||
List<string> defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup).Split(';').ToList();
|
||||
List<string> defines = PlayerSettings.GetScriptingDefineSymbols(namedBuildTarget).Split(';').ToList();
|
||||
|
||||
bool alreadyExists = false;
|
||||
|
||||
@@ -38,7 +41,7 @@ namespace SRDebugger.Editor
|
||||
defines.Add(define);
|
||||
}
|
||||
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, string.Join(";", defines.ToArray()));
|
||||
PlayerSettings.SetScriptingDefineSymbols(namedBuildTarget, string.Join(";", defines.ToArray()));
|
||||
}
|
||||
}
|
||||
static void ForceRecompile()
|
||||
|
||||
@@ -45,7 +45,9 @@ namespace SRDebugger.Editor
|
||||
private List<CategoryState> _categoryStates = new List<CategoryState>();
|
||||
|
||||
private Dictionary<Type, Action<OptionDefinition>> _typeLookup;
|
||||
|
||||
private Dictionary<string, List<OptionDefinition>> _options;
|
||||
private List<string> _categories;
|
||||
|
||||
private Vector2 _scrollPosition;
|
||||
private bool _queueRefresh;
|
||||
@@ -142,6 +144,7 @@ namespace SRDebugger.Editor
|
||||
}
|
||||
|
||||
_options = new Dictionary<string, List<OptionDefinition>>();
|
||||
_categories = new List<string>();
|
||||
|
||||
foreach (var option in Service.Options.Options)
|
||||
{
|
||||
@@ -151,6 +154,7 @@ namespace SRDebugger.Editor
|
||||
{
|
||||
list = new List<OptionDefinition>();
|
||||
_options[option.Category] = list;
|
||||
_categories.Add(option.Category);
|
||||
}
|
||||
|
||||
list.Add(option);
|
||||
@@ -166,6 +170,8 @@ namespace SRDebugger.Editor
|
||||
kv.Value.Sort((d1, d2) => d1.SortPriority.CompareTo(d2.SortPriority));
|
||||
}
|
||||
|
||||
_categories.Sort();
|
||||
|
||||
_activeOptionsService = Service.Options;
|
||||
_activeOptionsService.OptionsUpdated += OnOptionsUpdated;
|
||||
}
|
||||
@@ -210,27 +216,28 @@ namespace SRDebugger.Editor
|
||||
|
||||
_scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
|
||||
|
||||
foreach (var kv in _options)
|
||||
foreach (string category in _categories)
|
||||
{
|
||||
var state = _categoryStates.FirstOrDefault(p => p.Name == kv.Key);
|
||||
List<OptionDefinition> options = _options[category];
|
||||
|
||||
var state = _categoryStates.FirstOrDefault(p => p.Name == category);
|
||||
if (state == null)
|
||||
{
|
||||
state = new CategoryState()
|
||||
{
|
||||
Name = kv.Key,
|
||||
Name = category,
|
||||
IsOpen = true
|
||||
};
|
||||
_categoryStates.Add(state);
|
||||
}
|
||||
|
||||
state.IsOpen = EditorGUILayout.Foldout(state.IsOpen, kv.Key, _foldout);
|
||||
|
||||
state.IsOpen = EditorGUILayout.Foldout(state.IsOpen, category, _foldout);
|
||||
|
||||
if (!state.IsOpen)
|
||||
continue;
|
||||
|
||||
EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);
|
||||
OnGUI_Category(kv.Value);
|
||||
OnGUI_Category(options);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
@@ -727,7 +727,7 @@
|
||||
settings.MaximumConsoleEntries =
|
||||
EditorGUILayout.IntSlider(
|
||||
new GUIContent("Max Console Entries",
|
||||
"The maximum size of the console buffer. Higher values may cause performance issues on slower devices."),
|
||||
"The maximum size of the console buffer. Higher values use more memory and may cause performance issues on slower devices."),
|
||||
settings.MaximumConsoleEntries, 100, 6000);
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
@@ -54,6 +54,22 @@ namespace SRDebugger
|
||||
/// </summary>
|
||||
bool IsUsable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Message presented to the user to describe the privacy policy.
|
||||
/// Should be one or two sentences, and include markup that presents the visual of a link (see example below).
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <![CDATA[
|
||||
/// "By submitting this form you agree to Your Company Ltd processing your data and agree to our <color=#57B3F4>privacy policy</color>."
|
||||
/// ]]>
|
||||
/// </example>
|
||||
string PrivacyPolicyMessage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Return the URL to the privacy policy for the user to visit if they choose to read it.
|
||||
/// </summary>
|
||||
string PrivacyPolicyUrl { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Submit a new bug report to the handler.
|
||||
/// </summary>
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
{
|
||||
public static class SRDebugApi
|
||||
{
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
public const string PrivacyPolicyUrl = "https://www.stompyrobot.uk/tools/srdebugger/privacy-policy";
|
||||
|
||||
public const string Protocol = "https://";
|
||||
#else
|
||||
public const string Protocol = "http://";
|
||||
#endif
|
||||
|
||||
public const string EndPoint = Protocol + "srdebugger.stompyrobot.uk";
|
||||
|
||||
|
||||
@@ -101,11 +101,7 @@
|
||||
|
||||
yield return _webRequest.SendWebRequest();
|
||||
|
||||
#if UNITY_2018 || UNITY_2019
|
||||
bool isError = _webRequest.isNetworkError;
|
||||
#else
|
||||
bool isError = _webRequest.result == UnityWebRequest.Result.ConnectionError || _webRequest.result == UnityWebRequest.Result.DataProcessingError;
|
||||
#endif
|
||||
bool isError = _webRequest.result != UnityWebRequest.Result.Success;
|
||||
|
||||
if (isError)
|
||||
{
|
||||
|
||||
@@ -15,6 +15,19 @@ namespace SRDebugger.Internal
|
||||
get { return Settings.Instance.EnableBugReporter && !string.IsNullOrWhiteSpace(Settings.Instance.ApiKey); }
|
||||
}
|
||||
|
||||
public string PrivacyPolicyMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return "By submitting this bug report you agree to our <color=#57B3F4>privacy policy</color>.";
|
||||
}
|
||||
}
|
||||
|
||||
public string PrivacyPolicyUrl
|
||||
{
|
||||
get { return SRDebugApi.PrivacyPolicyUrl; }
|
||||
}
|
||||
|
||||
public void Submit(BugReport report, Action<BugReportSubmitResult> onComplete, IProgress<float> progress)
|
||||
{
|
||||
BugReportApi.Submit(report, Settings.Instance.ApiKey, onComplete, progress);
|
||||
|
||||
@@ -84,10 +84,11 @@ namespace SRDebugger
|
||||
/// <param name="setter">Method to set the value of the property (can be null if read-only)</param>
|
||||
/// <param name="category">Category to display the option in.</param>
|
||||
/// <param name="sortPriority">Sort priority to arrange the option within the category.</param>
|
||||
/// <param name="attributes">Attributes that apply to this option (e.g. NumberRange)</param>
|
||||
/// <returns>The created option definition.</returns>
|
||||
public static OptionDefinition Create<T>(string name, Func<T> getter, Action<T> setter = null, string category = "Default", int sortPriority = 0)
|
||||
public static OptionDefinition Create<T>(string name, Func<T> getter, Action<T> setter = null, string category = "Default", int sortPriority = 0, Attribute[] attributes = null)
|
||||
{
|
||||
return new OptionDefinition(name, category, sortPriority, PropertyReference.FromLambda(getter, setter));
|
||||
return new OptionDefinition(name, category, sortPriority, PropertyReference.FromLambda(getter, setter, attributes));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
private static IOptionsService _optionsService;
|
||||
private static IDockConsoleService _dockConsoleService;
|
||||
|
||||
#if UNITY_EDITOR && ((!UNITY_2017 && !UNITY_2018 && !UNITY_2019) || UNITY_2019_3_OR_NEWER)
|
||||
#if UNITY_EDITOR
|
||||
[UnityEngine.RuntimeInitializeOnLoadMethod(UnityEngine.RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
public static void RuntimeInitialize()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SRDebugger.Internal
|
||||
namespace SRDebugger.Internal
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -22,15 +20,9 @@ namespace SRDebugger.Internal
|
||||
|
||||
switch (Application.platform)
|
||||
{
|
||||
#if UNITY_5 || UNITY_5_3_OR_NEWER
|
||||
case RuntimePlatform.WSAPlayerARM:
|
||||
case RuntimePlatform.WSAPlayerX64:
|
||||
case RuntimePlatform.WSAPlayerX86:
|
||||
#else
|
||||
case RuntimePlatform.MetroPlayerARM:
|
||||
case RuntimePlatform.MetroPlayerX64:
|
||||
case RuntimePlatform.MetroPlayerX86:
|
||||
#endif
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -55,7 +47,7 @@ namespace SRDebugger.Internal
|
||||
return false;
|
||||
}
|
||||
|
||||
var e = Object.FindObjectOfType<EventSystem>();
|
||||
var e = Object.FindFirstObjectByType<EventSystem>();
|
||||
|
||||
// Check if EventSystem is in the scene but not registered yet
|
||||
if (e != null && e.gameObject.activeSelf && e.enabled)
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
|
||||
namespace SRDebugger.Profiler
|
||||
namespace SRDebugger.Profiler
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using SRDebugger.Services;
|
||||
using SRF;
|
||||
using SRF.Service;
|
||||
using UnityEngine;
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
using UnityEngine.Rendering;
|
||||
#else
|
||||
using UnityEngine.Experimental.Rendering;
|
||||
#endif
|
||||
|
||||
public class SRPProfilerService : SRServiceBase<IProfilerService>, IProfilerService
|
||||
{
|
||||
@@ -35,6 +31,8 @@ namespace SRDebugger.Profiler
|
||||
// Time that render pipeline starts
|
||||
private double _renderStartTime;
|
||||
|
||||
private long _renderStartTimeFrame;
|
||||
|
||||
// Time between scripted render pipeline starts + EndOfFrame
|
||||
private double _renderDuration;
|
||||
|
||||
@@ -49,12 +47,7 @@ namespace SRDebugger.Profiler
|
||||
CachedGameObject.hideFlags = HideFlags.NotEditable;
|
||||
CachedTransform.SetParent(Hierarchy.Get("SRDebugger"), true);
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
RenderPipelineManager.beginFrameRendering += RenderPipelineOnBeginFrameRendering;
|
||||
#else
|
||||
RenderPipeline.beginFrameRendering += RenderPipelineOnBeginFrameRendering;
|
||||
#endif
|
||||
|
||||
RenderPipelineManager.beginContextRendering += RenderPipelineOnBeginContextRendering;
|
||||
StartCoroutine(EndOfFrameCoroutine());
|
||||
}
|
||||
|
||||
@@ -113,12 +106,15 @@ namespace SRDebugger.Profiler
|
||||
_updateDuration = _stopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
private void RenderPipelineOnBeginFrameRendering(ScriptableRenderContext context, Camera[] cameras)
|
||||
#else
|
||||
private void RenderPipelineOnBeginFrameRendering(Camera[] obj)
|
||||
#endif
|
||||
private void RenderPipelineOnBeginContextRendering(ScriptableRenderContext context, List<Camera> list)
|
||||
{
|
||||
// Account for if there are multiple render contexts per frame. We only want to know when the first rendering is started on the frame.
|
||||
if(_renderStartTimeFrame == Time.renderedFrameCount)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_renderStartTimeFrame = Time.renderedFrameCount;
|
||||
_renderStartTime = _stopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
|
||||
@@ -136,4 +132,3 @@ namespace SRDebugger.Profiler
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -13,6 +13,11 @@ namespace SRDebugger.Services
|
||||
/// </summary>
|
||||
bool IsUsable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Link to the privacy policy for the current bug report handler.
|
||||
/// </summary>
|
||||
string PrivacyPolicyUrl { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Set the handler that will submit bug reports.
|
||||
/// </summary>
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
namespace SRDebugger.Services
|
||||
{
|
||||
public delegate void ConsoleStateChangedEventHandler(LogType logType, bool newState);
|
||||
public delegate void ConsoleTextFilterChangedEventHandler(string newFilter);
|
||||
|
||||
public interface IConsoleFilterState
|
||||
{
|
||||
event ConsoleStateChangedEventHandler FilterStateChange;
|
||||
event ConsoleTextFilterChangedEventHandler TextFilterChange;
|
||||
|
||||
/// <summary>
|
||||
/// Set whether log messages with <paramref name="logType"/> severity
|
||||
@@ -23,5 +25,10 @@ namespace SRDebugger.Services
|
||||
/// <param name="logType">Type of message (only Error/Warning/Log are used. <see cref="LogType.Exception"/> and <see cref="LogType.Assert"/> will redirect to <see cref="LogType.Error"/></param>
|
||||
/// <returns>True if the log type is displayed.</returns>
|
||||
bool GetConsoleFilterState(LogType logType);
|
||||
|
||||
/// <summary>
|
||||
/// What text is the console log being filtered by.
|
||||
/// </summary>
|
||||
string TextFilter { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,17 @@ namespace SRDebugger.Services
|
||||
using System;
|
||||
using Profiler;
|
||||
using SRF.Service;
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Experimental.Rendering;
|
||||
#endif
|
||||
|
||||
public static class ProfilerServiceSelector
|
||||
{
|
||||
[ServiceSelector(typeof(IProfilerService))]
|
||||
public static Type GetProfilerServiceType()
|
||||
{
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
if(GraphicsSettings.defaultRenderPipeline != null)
|
||||
{
|
||||
return typeof(SRPProfilerService);
|
||||
}
|
||||
#endif
|
||||
|
||||
return typeof(ProfilerServiceImpl);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
public string PrivacyPolicyUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return _handler != null ? _handler.PrivacyPolicyUrl : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHandler(IBugReporterHandler handler)
|
||||
{
|
||||
Debug.LogFormat("[SRDebugger] Bug Report handler set to {0}", handler);
|
||||
|
||||
@@ -3,14 +3,16 @@ using SRDebugger.Services;
|
||||
using SRF.Service;
|
||||
using UnityEngine;
|
||||
|
||||
namespace StompyRobot.SRDebugger.Scripts.Services.Implementation
|
||||
namespace SRDebugger.Assets.StompyRobot.SRDebugger.Scripts.Services.Implementation
|
||||
{
|
||||
[Service(typeof(IConsoleFilterState))]
|
||||
public sealed class ConsoleFilterStateService : IConsoleFilterState
|
||||
{
|
||||
public event ConsoleStateChangedEventHandler FilterStateChange;
|
||||
public event ConsoleTextFilterChangedEventHandler TextFilterChange;
|
||||
|
||||
private readonly bool[] _states;
|
||||
private string _textFilter = "";
|
||||
|
||||
public ConsoleFilterStateService()
|
||||
{
|
||||
@@ -41,6 +43,18 @@ namespace StompyRobot.SRDebugger.Scripts.Services.Implementation
|
||||
return _states[(int)type];
|
||||
}
|
||||
|
||||
public string TextFilter
|
||||
{
|
||||
get => _textFilter;
|
||||
set {
|
||||
if (value != _textFilter)
|
||||
{
|
||||
_textFilter = value;
|
||||
TextFilterChange?.Invoke(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static LogType GetType(LogType type)
|
||||
{
|
||||
switch (type)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
[Service(typeof(ISystemInformationService))]
|
||||
public class StandardSystemInformationService : ISystemInformationService
|
||||
{
|
||||
private readonly Dictionary<string, IList<InfoEntry>> _info = new Dictionary<string, IList<InfoEntry>>();
|
||||
private readonly Dictionary<string, List<InfoEntry>> _info = new Dictionary<string, List<InfoEntry>>();
|
||||
|
||||
public StandardSystemInformationService()
|
||||
{
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
public IList<InfoEntry> GetInfo(string category)
|
||||
{
|
||||
IList<InfoEntry> list;
|
||||
List<InfoEntry> list;
|
||||
|
||||
if (!_info.TryGetValue(category, out list))
|
||||
{
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
public void Add(InfoEntry info, string category = "Default")
|
||||
{
|
||||
IList<InfoEntry> list;
|
||||
List<InfoEntry> list;
|
||||
|
||||
if (!_info.TryGetValue(category, out list))
|
||||
{
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
private void CreateDefaultSet()
|
||||
{
|
||||
_info.Add("System", new[]
|
||||
_info.Add("System", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Operating System", UnityEngine.SystemInfo.operatingSystem),
|
||||
InfoEntry.Create("Device Name", UnityEngine.SystemInfo.deviceName, true),
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
if (SystemInfo.batteryStatus != BatteryStatus.Unknown)
|
||||
{
|
||||
_info.Add("Battery", new[]
|
||||
_info.Add("Battery", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Status", UnityEngine.SystemInfo.batteryStatus),
|
||||
InfoEntry.Create("Battery Level", UnityEngine.SystemInfo.batteryLevel)
|
||||
@@ -111,7 +111,7 @@
|
||||
const string IL2CPP = "No";
|
||||
#endif
|
||||
|
||||
_info.Add("Unity", new[]
|
||||
_info.Add("Unity", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Version", Application.unityVersion),
|
||||
InfoEntry.Create("Debug", Debug.isDebugBuild),
|
||||
@@ -129,7 +129,7 @@
|
||||
InfoEntry.Create("SRDebugger Version", SRDebug.Version),
|
||||
});
|
||||
|
||||
_info.Add("Display", new[]
|
||||
_info.Add("Display", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Resolution", () => Screen.width + "x" + Screen.height),
|
||||
InfoEntry.Create("DPI", () => Screen.dpi),
|
||||
@@ -138,7 +138,7 @@
|
||||
InfoEntry.Create("Orientation", () => Screen.orientation),
|
||||
});
|
||||
|
||||
_info.Add("Runtime", new[]
|
||||
_info.Add("Runtime", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Play Time", () => Time.unscaledTime),
|
||||
InfoEntry.Create("Level Play Time", () => Time.timeSinceLevelLoad),
|
||||
@@ -181,7 +181,7 @@
|
||||
_info.Add("Build", manifestList);
|
||||
}
|
||||
|
||||
_info.Add("Features", new[]
|
||||
_info.Add("Features", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Location", UnityEngine.SystemInfo.supportsLocationService),
|
||||
InfoEntry.Create("Accelerometer", UnityEngine.SystemInfo.supportsAccelerometer),
|
||||
@@ -191,21 +191,15 @@
|
||||
});
|
||||
|
||||
#if UNITY_IOS
|
||||
|
||||
_info.Add("iOS", new[] {
|
||||
|
||||
#if UNITY_5 || UNITY_5_3_OR_NEWER
|
||||
_info.Add("iOS", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Generation", UnityEngine.iOS.Device.generation),
|
||||
InfoEntry.Create("Ad Tracking", UnityEngine.iOS.Device.advertisingTrackingEnabled),
|
||||
#else
|
||||
InfoEntry.Create("Generation", iPhone.generation),
|
||||
InfoEntry.Create("Ad Tracking", iPhone.advertisingTrackingEnabled),
|
||||
#endif
|
||||
});
|
||||
|
||||
#endif
|
||||
|
||||
#pragma warning disable 618
|
||||
_info.Add("Graphics - Device", new[]
|
||||
_info.Add("Graphics - Device", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("Device Name", UnityEngine.SystemInfo.graphicsDeviceName),
|
||||
InfoEntry.Create("Device Vendor", UnityEngine.SystemInfo.graphicsDeviceVendor),
|
||||
@@ -214,7 +208,7 @@
|
||||
InfoEntry.Create("Max Tex Size", UnityEngine.SystemInfo.maxTextureSize),
|
||||
});
|
||||
|
||||
_info.Add("Graphics - Features", new[]
|
||||
_info.Add("Graphics - Features", new List<InfoEntry>
|
||||
{
|
||||
InfoEntry.Create("UV Starts at top", UnityEngine.SystemInfo.graphicsUVStartsAtTop),
|
||||
InfoEntry.Create("Shader Level", UnityEngine.SystemInfo.graphicsShaderLevel),
|
||||
|
||||
@@ -574,7 +574,7 @@ namespace SRDebugger
|
||||
|
||||
[SerializeField] private bool _isEnabled = true;
|
||||
|
||||
[SerializeField] private bool _disableWelcomePopup = false;
|
||||
[SerializeField] private bool _disableWelcomePopup;
|
||||
|
||||
[SerializeField] private UIModes _uiInputMode = UIModes.NewInputSystem;
|
||||
|
||||
@@ -596,7 +596,7 @@ namespace SRDebugger
|
||||
|
||||
[SerializeField] private bool _keyboardModifierControl = true;
|
||||
|
||||
[SerializeField] private bool _keyboardModifierAlt = false;
|
||||
[SerializeField] private bool _keyboardModifierAlt;
|
||||
|
||||
[SerializeField] private bool _keyboardModifierShift = true;
|
||||
|
||||
@@ -646,7 +646,7 @@ namespace SRDebugger
|
||||
|
||||
[SerializeField] private float _uiScale = 1;
|
||||
|
||||
[SerializeField] private bool _unloadOnClose = false;
|
||||
[SerializeField] private bool _unloadOnClose;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace SRDebugger {
|
||||
public static class VersionInfo {
|
||||
public const string Version = "1.12.1";
|
||||
public const string Version = "1.13.1";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user