移除不用的脚本
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();
|
||||
|
||||
Reference in New Issue
Block a user