com.elestrago.unity.entitas-redux 3.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +354 -0
- package/CHANGELOG.md.meta +7 -0
- package/Docs/EntitasReduxAPI.chm +0 -0
- package/Docs/EntitasReduxAPI.chm.meta +7 -0
- package/Docs/Images/portrait.png +0 -0
- package/Docs/Images/portrait.png.meta +91 -0
- package/Docs/Images/social_share_image.png +0 -0
- package/Docs/Images/social_share_image.png.meta +91 -0
- package/Docs/Images.meta +8 -0
- package/Docs.meta +8 -0
- package/LICENSE.md +21 -0
- package/LICENSE.md.meta +7 -0
- package/Licenses/LICENSE.txt +21 -0
- package/Licenses/LICENSE.txt.meta +7 -0
- package/Licenses/SCHMID_LICENSE.txt +22 -0
- package/Licenses/SCHMID_LICENSE.txt.meta +7 -0
- package/Licenses.meta +8 -0
- package/Plugins/EntitasRedux.Command.Generator.dll +0 -0
- package/Plugins/EntitasRedux.Command.Generator.dll.meta +89 -0
- package/Plugins/EntitasRedux.Core.Generator.dll +0 -0
- package/Plugins/EntitasRedux.Core.Generator.dll.meta +89 -0
- package/Plugins/EntitasRedux.Core.Libs.dll +0 -0
- package/Plugins/EntitasRedux.Core.Libs.dll.meta +75 -0
- package/Plugins/EntitasRedux.Core.dll +0 -0
- package/Plugins/EntitasRedux.Core.dll.meta +75 -0
- package/Plugins.meta +8 -0
- package/README.md +106 -0
- package/README.md.meta +7 -0
- package/Scripts/AssemblyInfo.cs +39 -0
- package/Scripts/AssemblyInfo.cs.meta +11 -0
- package/Scripts/Blueprints/AssemblyInfo.cs +39 -0
- package/Scripts/Blueprints/AssemblyInfo.cs.meta +11 -0
- package/Scripts/Blueprints/BlueprintBase.cs +66 -0
- package/Scripts/Blueprints/BlueprintBase.cs.meta +11 -0
- package/Scripts/Blueprints/BlueprintBehaviourBase.cs +63 -0
- package/Scripts/Blueprints/BlueprintBehaviourBase.cs.meta +11 -0
- package/Scripts/Blueprints/Editor/AssemblyInfo.cs +35 -0
- package/Scripts/Blueprints/Editor/AssemblyInfo.cs.meta +11 -0
- package/Scripts/Blueprints/Editor/BlueprintBaseInspector.cs +67 -0
- package/Scripts/Blueprints/Editor/BlueprintBaseInspector.cs.meta +11 -0
- package/Scripts/Blueprints/Editor/BlueprintBehaviourBaseInspector.cs +67 -0
- package/Scripts/Blueprints/Editor/BlueprintBehaviourBaseInspector.cs.meta +11 -0
- package/Scripts/Blueprints/Editor/BlueprintInspector.cs +268 -0
- package/Scripts/Blueprints/Editor/BlueprintInspector.cs.meta +11 -0
- package/Scripts/Blueprints/Editor/EntitasRedux.Blueprints.Editor.asmdef +20 -0
- package/Scripts/Blueprints/Editor/EntitasRedux.Blueprints.Editor.asmdef.meta +7 -0
- package/Scripts/Blueprints/Editor.meta +8 -0
- package/Scripts/Blueprints/EntitasRedux.Blueprints.asmdef +15 -0
- package/Scripts/Blueprints/EntitasRedux.Blueprints.asmdef.meta +7 -0
- package/Scripts/Blueprints.meta +8 -0
- package/Scripts/Core/Utils/UnsubscribeEvent.cs +20 -0
- package/Scripts/Core/Utils/UnsubscribeEvent.cs.meta +3 -0
- package/Scripts/Core/Utils/UnsubscribeEventExtensions.cs +13 -0
- package/Scripts/Core/Utils/UnsubscribeEventExtensions.cs.meta +3 -0
- package/Scripts/Core/Utils.meta +3 -0
- package/Scripts/Core/View/IEntityHashHolder.cs +7 -0
- package/Scripts/Core/View/IEntityHashHolder.cs.meta +3 -0
- package/Scripts/Core/View/ILinkable.cs +9 -0
- package/Scripts/Core/View/ILinkable.cs.meta +3 -0
- package/Scripts/Core/View/Impls/EntityHashHolder.cs +11 -0
- package/Scripts/Core/View/Impls/EntityHashHolder.cs.meta +3 -0
- package/Scripts/Core/View/Impls/LinkableView.Editor.cs +41 -0
- package/Scripts/Core/View/Impls/LinkableView.Editor.cs.meta +3 -0
- package/Scripts/Core/View/Impls/LinkableView.cs +99 -0
- package/Scripts/Core/View/Impls/LinkableView.cs.meta +3 -0
- package/Scripts/Core/View/Impls.meta +3 -0
- package/Scripts/Core/View.meta +3 -0
- package/Scripts/Core.meta +8 -0
- package/Scripts/Editor/AssemblyInfo.cs +39 -0
- package/Scripts/Editor/AssemblyInfo.cs.meta +11 -0
- package/Scripts/Editor/CreateScriptMenuItems.cs +89 -0
- package/Scripts/Editor/CreateScriptMenuItems.cs.meta +11 -0
- package/Scripts/Editor/EntitasRedux.Editor.asmdef +18 -0
- package/Scripts/Editor/EntitasRedux.Editor.asmdef.meta +7 -0
- package/Scripts/Editor/EntitasReduxStyles.cs +65 -0
- package/Scripts/Editor/EntitasReduxStyles.cs.meta +11 -0
- package/Scripts/Editor/Extensions/ColorExtensions.cs +50 -0
- package/Scripts/Editor/Extensions/ColorExtensions.cs.meta +11 -0
- package/Scripts/Editor/Extensions/PublicMemberInfoExtensions.cs +60 -0
- package/Scripts/Editor/Extensions/PublicMemberInfoExtensions.cs.meta +11 -0
- package/Scripts/Editor/Extensions/SerializationTypeExtensions.cs +124 -0
- package/Scripts/Editor/Extensions/SerializationTypeExtensions.cs.meta +11 -0
- package/Scripts/Editor/Extensions/StringExtensions.cs +141 -0
- package/Scripts/Editor/Extensions/StringExtensions.cs.meta +11 -0
- package/Scripts/Editor/Extensions/TypeExtensions.cs +216 -0
- package/Scripts/Editor/Extensions/TypeExtensions.cs.meta +11 -0
- package/Scripts/Editor/Extensions.meta +8 -0
- package/Scripts/Editor/Images/EntitasContextErrorHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasContextErrorHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasContextHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasContextHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasEntityErrorHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasEntityErrorHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasEntityHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasEntityHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasEntityLinkHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasEntityLinkHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasEntityLinkWarnHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasEntityLinkWarnHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasHeader.png +0 -0
- package/Scripts/Editor/Images/EntitasHeader.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasSystemsHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasSystemsHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images/EntitasSystemsWarnHierarchyIcon.png +0 -0
- package/Scripts/Editor/Images/EntitasSystemsWarnHierarchyIcon.png.meta +93 -0
- package/Scripts/Editor/Images.meta +8 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultArrayCreator.cs +43 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultArrayCreator.cs.meta +11 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultStringCreator.cs +42 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultStringCreator.cs.meta +11 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator/IDefaultInstanceCreator.cs +36 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator/IDefaultInstanceCreator.cs.meta +11 -0
- package/Scripts/Editor/Inspector/DefaultInstanceCreator.meta +8 -0
- package/Scripts/Editor/Inspector/Entity/EntityDrawer.cs +927 -0
- package/Scripts/Editor/Inspector/Entity/EntityDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/Entity/EntityInspector.cs +57 -0
- package/Scripts/Editor/Inspector/Entity/EntityInspector.cs.meta +11 -0
- package/Scripts/Editor/Inspector/Entity.meta +8 -0
- package/Scripts/Editor/Inspector/IComponentDrawer.cs +36 -0
- package/Scripts/Editor/Inspector/IComponentDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/AnimationCurveTypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/AnimationCurveTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ArrayTypeDrawer.cs +282 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ArrayTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/BoolTypeDrawer.cs +43 -0
- package/Scripts/Editor/Inspector/TypeDrawer/BoolTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/BoundsTypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/BoundsTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/CharTypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/CharTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ColorTypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ColorTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/DateTimeTypeDrawer.cs +49 -0
- package/Scripts/Editor/Inspector/TypeDrawer/DateTimeTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/DictionaryTypeDrawer.cs +131 -0
- package/Scripts/Editor/Inspector/TypeDrawer/DictionaryTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/DoubleTypeDrawer.cs +43 -0
- package/Scripts/Editor/Inspector/TypeDrawer/DoubleTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/EnumTypeDrawer.cs +48 -0
- package/Scripts/Editor/Inspector/TypeDrawer/EnumTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/FloatTypeDrawer.cs +43 -0
- package/Scripts/Editor/Inspector/TypeDrawer/FloatTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/HashSetTypeDrawer.cs +124 -0
- package/Scripts/Editor/Inspector/TypeDrawer/HashSetTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ITypeDrawer.cs +36 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ITypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/IntTypeDrawer.cs +43 -0
- package/Scripts/Editor/Inspector/TypeDrawer/IntTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ListTypeDrawer.cs +163 -0
- package/Scripts/Editor/Inspector/TypeDrawer/ListTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/RectTypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/RectTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/StringTypeDrawer.cs +43 -0
- package/Scripts/Editor/Inspector/TypeDrawer/StringTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/UnityObjectTypeDrawer.cs +49 -0
- package/Scripts/Editor/Inspector/TypeDrawer/UnityObjectTypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/Vector2TypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/Vector2TypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/Vector3TypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/Vector3TypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer/Vector4TypeDrawer.cs +44 -0
- package/Scripts/Editor/Inspector/TypeDrawer/Vector4TypeDrawer.cs.meta +11 -0
- package/Scripts/Editor/Inspector/TypeDrawer.meta +8 -0
- package/Scripts/Editor/Inspector.meta +8 -0
- package/Scripts/Editor/MenuItems.cs +84 -0
- package/Scripts/Editor/MenuItems.cs.meta +11 -0
- package/Scripts/Editor/PlayModeHelper.cs +75 -0
- package/Scripts/Editor/PlayModeHelper.cs.meta +11 -0
- package/Scripts/Editor/Reflection/AttributeInfo.cs +44 -0
- package/Scripts/Editor/Reflection/AttributeInfo.cs.meta +11 -0
- package/Scripts/Editor/Reflection/PublicMemberInfo.cs +95 -0
- package/Scripts/Editor/Reflection/PublicMemberInfo.cs.meta +11 -0
- package/Scripts/Editor/Reflection.meta +8 -0
- package/Scripts/Editor/ScriptTemplates/CleanupSystem.txt +15 -0
- package/Scripts/Editor/ScriptTemplates/CleanupSystem.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates/Component.txt +9 -0
- package/Scripts/Editor/ScriptTemplates/Component.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates/FixedUpdateSystem.txt +15 -0
- package/Scripts/Editor/ScriptTemplates/FixedUpdateSystem.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates/InitializeSystem.txt +15 -0
- package/Scripts/Editor/ScriptTemplates/InitializeSystem.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates/LateUpdateSystem.txt +15 -0
- package/Scripts/Editor/ScriptTemplates/LateUpdateSystem.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates/ReactiveSystem.txt +39 -0
- package/Scripts/Editor/ScriptTemplates/ReactiveSystem.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates/UpdateSystem.txt +15 -0
- package/Scripts/Editor/ScriptTemplates/UpdateSystem.txt.meta +7 -0
- package/Scripts/Editor/ScriptTemplates.meta +8 -0
- package/Scripts/Editor/Tools/ColorTools.cs +59 -0
- package/Scripts/Editor/Tools/ColorTools.cs.meta +11 -0
- package/Scripts/Editor/Tools/EditorGUILayoutTools.cs +242 -0
- package/Scripts/Editor/Tools/EditorGUILayoutTools.cs.meta +11 -0
- package/Scripts/Editor/Tools/PlayerSettingsTools.cs +144 -0
- package/Scripts/Editor/Tools/PlayerSettingsTools.cs.meta +11 -0
- package/Scripts/Editor/Tools/PreferenceTools.cs +116 -0
- package/Scripts/Editor/Tools/PreferenceTools.cs.meta +11 -0
- package/Scripts/Editor/Tools/RefactorModeTools.cs +85 -0
- package/Scripts/Editor/Tools/RefactorModeTools.cs.meta +11 -0
- package/Scripts/Editor/Tools/ReflectionTools.cs +33 -0
- package/Scripts/Editor/Tools/ReflectionTools.cs.meta +3 -0
- package/Scripts/Editor/Tools/ScriptTools.cs +117 -0
- package/Scripts/Editor/Tools/ScriptTools.cs.meta +11 -0
- package/Scripts/Editor/Tools/SerializationTools.cs +91 -0
- package/Scripts/Editor/Tools/SerializationTools.cs.meta +11 -0
- package/Scripts/Editor/Tools.meta +8 -0
- package/Scripts/Editor/Window/AboutWindow.cs +153 -0
- package/Scripts/Editor/Window/AboutWindow.cs.meta +14 -0
- package/Scripts/Editor/Window.meta +8 -0
- package/Scripts/Editor.meta +8 -0
- package/Scripts/EntitasRedux.asmdef +13 -0
- package/Scripts/EntitasRedux.asmdef.meta +7 -0
- package/Scripts/Entity/EntityBehaviour.cs +82 -0
- package/Scripts/Entity/EntityBehaviour.cs.meta +11 -0
- package/Scripts/Entity.meta +8 -0
- package/Scripts/EntityLink.cs +85 -0
- package/Scripts/EntityLink.cs.meta +11 -0
- package/Scripts/Extensions/EntityLinkExtension.cs +52 -0
- package/Scripts/Extensions/EntityLinkExtension.cs.meta +11 -0
- package/Scripts/Extensions.meta +8 -0
- package/Scripts/VersionConstants.cs +58 -0
- package/Scripts/VersionConstants.cs.meta +11 -0
- package/Scripts/VisualDebugging/AssemblyInfo.cs +39 -0
- package/Scripts/VisualDebugging/AssemblyInfo.cs.meta +11 -0
- package/Scripts/VisualDebugging/ContextObserver/ContextObserver.cs +107 -0
- package/Scripts/VisualDebugging/ContextObserver/ContextObserver.cs.meta +11 -0
- package/Scripts/VisualDebugging/ContextObserver/ContextObserverBehaviour.cs +60 -0
- package/Scripts/VisualDebugging/ContextObserver/ContextObserverBehaviour.cs.meta +11 -0
- package/Scripts/VisualDebugging/ContextObserver/ContextObserverExtension.cs +47 -0
- package/Scripts/VisualDebugging/ContextObserver/ContextObserverExtension.cs.meta +11 -0
- package/Scripts/VisualDebugging/ContextObserver.meta +8 -0
- package/Scripts/VisualDebugging/DebugSystems/AvgResetInterval.cs +37 -0
- package/Scripts/VisualDebugging/DebugSystems/AvgResetInterval.cs.meta +11 -0
- package/Scripts/VisualDebugging/DebugSystems/DebugSystems.cs +477 -0
- package/Scripts/VisualDebugging/DebugSystems/DebugSystems.cs.meta +11 -0
- package/Scripts/VisualDebugging/DebugSystems/DebugSystemsBehaviour.cs +41 -0
- package/Scripts/VisualDebugging/DebugSystems/DebugSystemsBehaviour.cs.meta +11 -0
- package/Scripts/VisualDebugging/DebugSystems/SystemInfo.cs +347 -0
- package/Scripts/VisualDebugging/DebugSystems/SystemInfo.cs.meta +11 -0
- package/Scripts/VisualDebugging/DebugSystems.meta +8 -0
- package/Scripts/VisualDebugging/Editor/AssemblyInfo.cs +35 -0
- package/Scripts/VisualDebugging/Editor/AssemblyInfo.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/ContextObserver/ContextObserverInspector.cs +104 -0
- package/Scripts/VisualDebugging/Editor/ContextObserver/ContextObserverInspector.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/ContextObserver.meta +8 -0
- package/Scripts/VisualDebugging/Editor/DebugSystems/DebugSystemsBehaviourInspector.cs +709 -0
- package/Scripts/VisualDebugging/Editor/DebugSystems/DebugSystemsBehaviourInspector.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/DebugSystems.meta +8 -0
- package/Scripts/VisualDebugging/Editor/EntitasHierarchyIcon.cs +226 -0
- package/Scripts/VisualDebugging/Editor/EntitasHierarchyIcon.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/EntitasRedux.VisualDebugging.Editor.asmdef +21 -0
- package/Scripts/VisualDebugging/Editor/EntitasRedux.VisualDebugging.Editor.asmdef.meta +7 -0
- package/Scripts/VisualDebugging/Editor/EntitasStats.cs +131 -0
- package/Scripts/VisualDebugging/Editor/EntitasStats.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/EntityLinkInspector.cs +71 -0
- package/Scripts/VisualDebugging/Editor/EntityLinkInspector.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/Graph.cs +234 -0
- package/Scripts/VisualDebugging/Editor/Graph.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/VisualDebugStyles.cs +55 -0
- package/Scripts/VisualDebugging/Editor/VisualDebugStyles.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/VisualDebuggingEntitasExtension.cs +35 -0
- package/Scripts/VisualDebugging/Editor/VisualDebuggingEntitasExtension.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor/VisualDebuggingPreferences.cs +188 -0
- package/Scripts/VisualDebugging/Editor/VisualDebuggingPreferences.cs.meta +11 -0
- package/Scripts/VisualDebugging/Editor.meta +8 -0
- package/Scripts/VisualDebugging/EntitasRedux.VisualDebugging.asmdef +18 -0
- package/Scripts/VisualDebugging/EntitasRedux.VisualDebugging.asmdef.meta +7 -0
- package/Scripts/VisualDebugging/Extensions/GameObjectDestroyExtensions.cs +44 -0
- package/Scripts/VisualDebugging/Extensions/GameObjectDestroyExtensions.cs.meta +11 -0
- package/Scripts/VisualDebugging/Extensions.meta +8 -0
- package/Scripts/VisualDebugging.meta +8 -0
- package/Scripts.meta +8 -0
- package/package.json +30 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2020 Jeff Campbell
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
using JCMG.EntitasRedux.Editor;
|
|
27
|
+
using System;
|
|
28
|
+
using System.Collections.Generic;
|
|
29
|
+
using System.Linq;
|
|
30
|
+
using System.Text;
|
|
31
|
+
using UnityEditor;
|
|
32
|
+
using UnityEngine;
|
|
33
|
+
|
|
34
|
+
namespace JCMG.EntitasRedux.VisualDebugging.Editor
|
|
35
|
+
{
|
|
36
|
+
[CustomEditor(typeof(DebugSystemsBehaviour))]
|
|
37
|
+
internal sealed class DebugSystemsBehaviourInspector : UnityEditor.Editor
|
|
38
|
+
{
|
|
39
|
+
private enum SortMethod
|
|
40
|
+
{
|
|
41
|
+
Name,
|
|
42
|
+
NameDescending,
|
|
43
|
+
ExecutionTime,
|
|
44
|
+
ExecutionTimeDescending
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private int _lastRenderedFrameCount;
|
|
48
|
+
|
|
49
|
+
private Queue<float> _fixedUpdateSystemMonitorData;
|
|
50
|
+
private Queue<float> _updateSystemMonitorData;
|
|
51
|
+
private Queue<float> _lateUpdateSystemMonitorData;
|
|
52
|
+
|
|
53
|
+
private Graph _systemsMonitor;
|
|
54
|
+
private SortMethod _systemSortMethod;
|
|
55
|
+
|
|
56
|
+
private float _threshold;
|
|
57
|
+
|
|
58
|
+
private static bool _showDetails;
|
|
59
|
+
private static bool _showSystemsMonitor = true;
|
|
60
|
+
private static bool _showSystemsList = true;
|
|
61
|
+
|
|
62
|
+
private static bool _showInitializeSystems = true;
|
|
63
|
+
private static bool _showFixedUpdateSystems = true;
|
|
64
|
+
private static bool _showUpdateSystems = true;
|
|
65
|
+
private static bool _showLateUpdateSystems = true;
|
|
66
|
+
private static bool _showReactiveSystems = true;
|
|
67
|
+
private static bool _showCleanupSystems = true;
|
|
68
|
+
private static bool _showTearDownSystems = true;
|
|
69
|
+
private static bool _hideEmptySystems = true;
|
|
70
|
+
private static string _systemNameSearchString = string.Empty;
|
|
71
|
+
|
|
72
|
+
private static readonly StringBuilder STRING_BUILDER;
|
|
73
|
+
private static readonly GUILayoutOption[] LEGEND_LABEL_OPTIONS;
|
|
74
|
+
|
|
75
|
+
private static GUILayoutOption[] _leftLabelGUILayoutOptions;
|
|
76
|
+
|
|
77
|
+
// Data Capture
|
|
78
|
+
private const int SYSTEM_MONITOR_DATA_LENGTH = 60;
|
|
79
|
+
|
|
80
|
+
// Legend
|
|
81
|
+
private const int BOX_HEIGHT_WIDTH = 16;
|
|
82
|
+
|
|
83
|
+
// Top-Level Section Titles
|
|
84
|
+
private const string DETAILS_TITLE = "Overview";
|
|
85
|
+
private const string SYSTEMS_TITLE = "Systems";
|
|
86
|
+
private const string PERFORMANCE_TITLE = "Performance";
|
|
87
|
+
|
|
88
|
+
// Monitor UI
|
|
89
|
+
private const string AVERAGE_PERFORMANCE_TITLE = "Average System Performance";
|
|
90
|
+
private const string GRAPH_LEGEND = "Legend";
|
|
91
|
+
private const string FIXED_UPDATE_LEGEND = "Fixed Update";
|
|
92
|
+
private const string UPDATE_LEGEND = "Update";
|
|
93
|
+
private const string LATE_UPDATE_LEGEND = "Late Update";
|
|
94
|
+
|
|
95
|
+
// System Section Titles
|
|
96
|
+
private const string INITIALIZE_SYSTEMS_TITLE = "Initialize Systems";
|
|
97
|
+
private const string FIXED_UPDATE_SYSTEMS_TITLE = "Fixed Update Systems";
|
|
98
|
+
private const string UPDATE_SYSTEMS_TITLE = "Update Systems";
|
|
99
|
+
private const string LATE_UPDATE_SYSTEMS_TITLE = "Late Update Systems";
|
|
100
|
+
private const string REACTIVE_SYSTEMS_TITLE = "Reactive Systems";
|
|
101
|
+
private const string CLEANUP_SYSTEMS_TITLE = "Cleanup Systems";
|
|
102
|
+
private const string TEARDOWN_SYSTEMS_TITLE = "TearDown Systems";
|
|
103
|
+
|
|
104
|
+
// Count Labels
|
|
105
|
+
private const string INITIALIZE_SYSTEMS_COUNT_LABEL = "Initialize Systems";
|
|
106
|
+
private const string FIXED_UPDATE_SYSTEMS_COUNT_LABEL = "Fixed Update Systems";
|
|
107
|
+
private const string UPDATE_SYSTEMS_COUNT_LABEL = "Update Systems";
|
|
108
|
+
private const string LATE_UPDATE_SYSTEMS_COUNT_LABEL = "Late Update Systems";
|
|
109
|
+
private const string REACTIVE_SYSTEMS_COUNT_LABEL = "Reactive Systems";
|
|
110
|
+
private const string CLEANUP_SYSTEMS_COUNT_LABEL = "Cleanup Systems";
|
|
111
|
+
private const string TEARDOWN_SYSTEMS_COUNT_LABEL = "TearDown Systems";
|
|
112
|
+
private const string TOTAL_SYSTEMS_COUNT_LABEL = "Total Systems";
|
|
113
|
+
|
|
114
|
+
// Duration Labels
|
|
115
|
+
private const string DURATION_TIME_FORMAT = "{0,10:###0.00}";
|
|
116
|
+
private const string FIXED_UPDATE_DURATION_LABEL = "Fixed Update Duration";
|
|
117
|
+
private const string UPDATE_DURATION_LABEL = "Update Duration";
|
|
118
|
+
private const string LATE_UPDATE_DURATION_LABEL = "Late Update Duration";
|
|
119
|
+
private const string REACTIVE_DURATION_LABEL = "Reactive Duration";
|
|
120
|
+
private const string CLEANUP_DURATION_LABEL = "Cleanup Duration";
|
|
121
|
+
|
|
122
|
+
// Profiling Controls
|
|
123
|
+
private const string HIDE_EMPTY_SYSTEMS_LABEL = "Hide Empty Systems";
|
|
124
|
+
private const string THRESHOLD_SLIDER_LABEL = "Threshold Average in ms";
|
|
125
|
+
private const string RESET_AVERAGE_DURATION_LABEL = "Reset Average Interval";
|
|
126
|
+
private const string RESET_AVERAGE_NOW_LABEL = "Reset Average Now";
|
|
127
|
+
|
|
128
|
+
// Help Boxes
|
|
129
|
+
private const string PERFORMANCE_DESCRIPTION = "All performance statistics are meausured in milliseconds (ms).";
|
|
130
|
+
|
|
131
|
+
private const string SYSTEMS_DESCRIPTION = "These are all systems running as a part of this Feature. Toggles " +
|
|
132
|
+
"are available to selectively filter which systems are running.";
|
|
133
|
+
|
|
134
|
+
static DebugSystemsBehaviourInspector()
|
|
135
|
+
{
|
|
136
|
+
LEGEND_LABEL_OPTIONS = new[]
|
|
137
|
+
{
|
|
138
|
+
GUILayout.Width(BOX_HEIGHT_WIDTH),
|
|
139
|
+
GUILayout.Height(BOX_HEIGHT_WIDTH),
|
|
140
|
+
};
|
|
141
|
+
STRING_BUILDER = new StringBuilder(200);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private void OnEnable()
|
|
145
|
+
{
|
|
146
|
+
if (_leftLabelGUILayoutOptions == null)
|
|
147
|
+
{
|
|
148
|
+
_leftLabelGUILayoutOptions = new []
|
|
149
|
+
{
|
|
150
|
+
GUILayout.Width(150f)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
public override void OnInspectorGUI()
|
|
156
|
+
{
|
|
157
|
+
if (_systemsMonitor == null)
|
|
158
|
+
{
|
|
159
|
+
_systemsMonitor = new Graph(SYSTEM_MONITOR_DATA_LENGTH);
|
|
160
|
+
|
|
161
|
+
_fixedUpdateSystemMonitorData = new Queue<float>(new float[SYSTEM_MONITOR_DATA_LENGTH]);
|
|
162
|
+
_updateSystemMonitorData = new Queue<float>(new float[SYSTEM_MONITOR_DATA_LENGTH]);
|
|
163
|
+
_lateUpdateSystemMonitorData = new Queue<float>(new float[SYSTEM_MONITOR_DATA_LENGTH]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var debugSystemsBehaviour = (DebugSystemsBehaviour)target;
|
|
167
|
+
var systems = debugSystemsBehaviour.Systems;
|
|
168
|
+
|
|
169
|
+
EditorGUILayout.HelpBox(PERFORMANCE_DESCRIPTION, MessageType.Info);
|
|
170
|
+
|
|
171
|
+
EditorGUILayout.Space();
|
|
172
|
+
DrawSystemsOverview(systems);
|
|
173
|
+
|
|
174
|
+
EditorGUILayout.Space();
|
|
175
|
+
DrawSystemsMonitor(systems);
|
|
176
|
+
|
|
177
|
+
EditorGUILayout.Space();
|
|
178
|
+
DrawSystemList(systems);
|
|
179
|
+
|
|
180
|
+
EditorGUILayout.Space();
|
|
181
|
+
|
|
182
|
+
EditorUtility.SetDirty(target);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
private static void DrawSystemsOverview(DebugSystems systems)
|
|
186
|
+
{
|
|
187
|
+
_showDetails = EditorGUILayoutTools.DrawSectionHeaderToggle(DETAILS_TITLE, _showDetails);
|
|
188
|
+
if (_showDetails)
|
|
189
|
+
{
|
|
190
|
+
using (new EditorGUILayout.VerticalScope(EntitasReduxStyles.SectionContent))
|
|
191
|
+
{
|
|
192
|
+
EditorGUILayout.LabelField(INITIALIZE_SYSTEMS_COUNT_LABEL, systems.TotalInitializeSystemsCount.ToString());
|
|
193
|
+
EditorGUILayout.LabelField(FIXED_UPDATE_SYSTEMS_COUNT_LABEL, systems.TotalFixedUpdateSystemsCount.ToString());
|
|
194
|
+
EditorGUILayout.LabelField(UPDATE_SYSTEMS_COUNT_LABEL, systems.TotalUpdateSystemsCount.ToString());
|
|
195
|
+
EditorGUILayout.LabelField(LATE_UPDATE_SYSTEMS_COUNT_LABEL, systems.TotalLateUpdateSystemsCount.ToString());
|
|
196
|
+
EditorGUILayout.LabelField(REACTIVE_SYSTEMS_COUNT_LABEL, systems.TotalReactiveSystemsCount.ToString());
|
|
197
|
+
EditorGUILayout.LabelField(CLEANUP_SYSTEMS_COUNT_LABEL, systems.TotalCleanupSystemsCount.ToString());
|
|
198
|
+
EditorGUILayout.LabelField(TEARDOWN_SYSTEMS_COUNT_LABEL, systems.TotalTearDownSystemsCount.ToString());
|
|
199
|
+
EditorGUILayout.LabelField(TOTAL_SYSTEMS_COUNT_LABEL, systems.TotalSystemsCount.ToString());
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
private void DrawSystemsMonitor(DebugSystems systems)
|
|
205
|
+
{
|
|
206
|
+
_showSystemsMonitor = EditorGUILayoutTools.DrawSectionHeaderToggle(PERFORMANCE_TITLE, _showSystemsMonitor);
|
|
207
|
+
if (_showSystemsMonitor)
|
|
208
|
+
{
|
|
209
|
+
using (new EditorGUILayout.VerticalScope(VisualDebugStyles.SectionContent))
|
|
210
|
+
{
|
|
211
|
+
// Draw Average Performance Stats
|
|
212
|
+
using (new EditorGUILayout.VerticalScope())
|
|
213
|
+
{
|
|
214
|
+
EditorGUILayout.LabelField(AVERAGE_PERFORMANCE_TITLE, EditorStyles.boldLabel);
|
|
215
|
+
|
|
216
|
+
DrawDurationLabel(FIXED_UPDATE_DURATION_LABEL, systems.AverageFixedUpdateDuration);
|
|
217
|
+
DrawDurationLabel(UPDATE_DURATION_LABEL, systems.AverageUpdateDuration);
|
|
218
|
+
DrawDurationLabel(LATE_UPDATE_DURATION_LABEL, systems.AverageLateUpdateDuration);
|
|
219
|
+
DrawDurationLabel(REACTIVE_DURATION_LABEL, systems.AverageReactiveDuration);
|
|
220
|
+
DrawDurationLabel(CLEANUP_DURATION_LABEL, systems.AverageCleanupDuration);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Draw Legend
|
|
224
|
+
using (var legendScope = new EditorGUILayout.VerticalScope())
|
|
225
|
+
{
|
|
226
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
227
|
+
{
|
|
228
|
+
GUILayout.FlexibleSpace();
|
|
229
|
+
EditorGUILayout.LabelField(GRAPH_LEGEND, EditorStyles.boldLabel, GUILayout.Width(60f));
|
|
230
|
+
GUILayout.FlexibleSpace();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
GUILayout.Space(5);
|
|
234
|
+
|
|
235
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
236
|
+
{
|
|
237
|
+
DrawLegendLabel(FIXED_UPDATE_LEGEND, VisualDebuggingPreferences.FixedUpdateColor);
|
|
238
|
+
GUILayout.FlexibleSpace();
|
|
239
|
+
|
|
240
|
+
DrawLegendLabel(UPDATE_LEGEND, VisualDebuggingPreferences.UpdateColor);
|
|
241
|
+
GUILayout.FlexibleSpace();
|
|
242
|
+
|
|
243
|
+
DrawLegendLabel(LATE_UPDATE_LEGEND, VisualDebuggingPreferences.LateUpdateColor);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
EditorGUILayout.Space(5);
|
|
248
|
+
|
|
249
|
+
// Update Graph
|
|
250
|
+
if (!EditorApplication.isPaused)
|
|
251
|
+
{
|
|
252
|
+
AddSystemDurations(systems);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Draw Graph
|
|
256
|
+
const float GRAPH_HEIGHT = 100f;
|
|
257
|
+
_systemsMonitor.Draw(
|
|
258
|
+
new[]
|
|
259
|
+
{
|
|
260
|
+
_fixedUpdateSystemMonitorData.ToArray(),
|
|
261
|
+
_updateSystemMonitorData.ToArray(),
|
|
262
|
+
_lateUpdateSystemMonitorData.ToArray()
|
|
263
|
+
},
|
|
264
|
+
Screen.width,
|
|
265
|
+
GRAPH_HEIGHT,
|
|
266
|
+
new[]
|
|
267
|
+
{
|
|
268
|
+
VisualDebuggingPreferences.FixedUpdateColor,
|
|
269
|
+
VisualDebuggingPreferences.UpdateColor,
|
|
270
|
+
VisualDebuggingPreferences.LateUpdateColor
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private void DrawLegendLabel(string label, Color color)
|
|
277
|
+
{
|
|
278
|
+
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
|
|
279
|
+
{
|
|
280
|
+
var newGUIContent = new GUIContent(label);
|
|
281
|
+
var size = EditorStyles.label.CalcSize(newGUIContent);
|
|
282
|
+
EditorGUILayout.LabelField(newGUIContent, GUILayout.Width(size.x));
|
|
283
|
+
|
|
284
|
+
var fixedUpdateLegendRect = GUILayoutUtility.GetRect(
|
|
285
|
+
BOX_HEIGHT_WIDTH,
|
|
286
|
+
BOX_HEIGHT_WIDTH,
|
|
287
|
+
BOX_HEIGHT_WIDTH,
|
|
288
|
+
BOX_HEIGHT_WIDTH,
|
|
289
|
+
LEGEND_LABEL_OPTIONS);
|
|
290
|
+
|
|
291
|
+
EditorGUILayoutTools.DrawRectWithBorder(
|
|
292
|
+
fixedUpdateLegendRect,
|
|
293
|
+
2f,
|
|
294
|
+
color,
|
|
295
|
+
Color.black);
|
|
296
|
+
|
|
297
|
+
GUILayout.FlexibleSpace();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
private void DrawDurationLabel(string label, double duration)
|
|
302
|
+
{
|
|
303
|
+
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
|
|
304
|
+
{
|
|
305
|
+
var size = EditorStyles.label.CalcSize(new GUIContent(label));
|
|
306
|
+
EditorGUILayout.LabelField(label, _leftLabelGUILayoutOptions);
|
|
307
|
+
|
|
308
|
+
EditorGUILayout.LabelField(
|
|
309
|
+
string.Format(DURATION_TIME_FORMAT, duration),
|
|
310
|
+
//VisualDebugStyles.RightAlignGUIStyle,
|
|
311
|
+
GUILayout.MaxWidth(60f));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
private void DrawSystemList(DebugSystems systems)
|
|
316
|
+
{
|
|
317
|
+
_showSystemsList = EditorGUILayoutTools.DrawSectionHeaderToggle(SYSTEMS_TITLE, _showSystemsList);
|
|
318
|
+
if (_showSystemsList)
|
|
319
|
+
{
|
|
320
|
+
using (new EditorGUILayout.VerticalScope(EntitasReduxStyles.SectionContent))
|
|
321
|
+
{
|
|
322
|
+
EditorGUILayout.HelpBox(SYSTEMS_DESCRIPTION, MessageType.Info);
|
|
323
|
+
|
|
324
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
325
|
+
{
|
|
326
|
+
DebugSystems.avgResetInterval = (AvgResetInterval)EditorGUILayout.EnumPopup(
|
|
327
|
+
RESET_AVERAGE_DURATION_LABEL,
|
|
328
|
+
DebugSystems.avgResetInterval);
|
|
329
|
+
|
|
330
|
+
if (GUILayout.Button(RESET_AVERAGE_NOW_LABEL, EditorStyles.miniButton, GUILayout.Width(150f)))
|
|
331
|
+
{
|
|
332
|
+
systems.ResetDurations();
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
_threshold = EditorGUILayout.Slider(
|
|
337
|
+
THRESHOLD_SLIDER_LABEL,
|
|
338
|
+
_threshold,
|
|
339
|
+
0f,
|
|
340
|
+
33f);
|
|
341
|
+
|
|
342
|
+
_hideEmptySystems = EditorGUILayout.Toggle(HIDE_EMPTY_SYSTEMS_LABEL, _hideEmptySystems);
|
|
343
|
+
EditorGUILayout.Space();
|
|
344
|
+
|
|
345
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
346
|
+
{
|
|
347
|
+
_systemSortMethod = (SortMethod)EditorGUILayout.EnumPopup(
|
|
348
|
+
_systemSortMethod,
|
|
349
|
+
EditorStyles.popup,
|
|
350
|
+
GUILayout.Width(150));
|
|
351
|
+
_systemNameSearchString = EditorGUILayoutTools.SearchTextField(_systemNameSearchString);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
EditorGUILayout.Space();
|
|
355
|
+
|
|
356
|
+
DrawSystemSection(INITIALIZE_SYSTEMS_TITLE, ref _showInitializeSystems, systems, SystemInterfaceFlags.InitializeSystem);
|
|
357
|
+
DrawSystemSection(FIXED_UPDATE_SYSTEMS_TITLE, ref _showFixedUpdateSystems, systems, SystemInterfaceFlags.FixedUpdateSystem);
|
|
358
|
+
DrawSystemSection(UPDATE_SYSTEMS_TITLE, ref _showUpdateSystems, systems, SystemInterfaceFlags.UpdateSystem);
|
|
359
|
+
DrawSystemSection(LATE_UPDATE_SYSTEMS_TITLE, ref _showLateUpdateSystems, systems, SystemInterfaceFlags.LateUpdateSystem);
|
|
360
|
+
DrawSystemSection(REACTIVE_SYSTEMS_TITLE, ref _showReactiveSystems, systems, SystemInterfaceFlags.ReactiveSystem);
|
|
361
|
+
DrawSystemSection(CLEANUP_SYSTEMS_TITLE, ref _showCleanupSystems, systems, SystemInterfaceFlags.CleanupSystem);
|
|
362
|
+
DrawSystemSection(TEARDOWN_SYSTEMS_TITLE, ref _showTearDownSystems, systems, SystemInterfaceFlags.TearDownSystem);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
private void DrawSystemSection(string header,
|
|
368
|
+
ref bool showSystems,
|
|
369
|
+
DebugSystems systems,
|
|
370
|
+
SystemInterfaceFlags systemInterfaceFlags)
|
|
371
|
+
{
|
|
372
|
+
showSystems = EditorGUILayoutTools.DrawSectionHeaderToggle(header, showSystems);
|
|
373
|
+
if (showSystems && ShouldShowSystems(systems, systemInterfaceFlags))
|
|
374
|
+
{
|
|
375
|
+
using (new EditorGUILayout.VerticalScope(EntitasReduxStyles.SectionContent))
|
|
376
|
+
{
|
|
377
|
+
var systemsDrawn = DrawSystemInfos(systems, systemInterfaceFlags);
|
|
378
|
+
if (systemsDrawn == 0)
|
|
379
|
+
{
|
|
380
|
+
EditorGUILayout.LabelField(string.Empty);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
private int DrawSystemInfos(DebugSystems systems, SystemInterfaceFlags type)
|
|
387
|
+
{
|
|
388
|
+
IEnumerable<SystemInfo> systemInfos = null;
|
|
389
|
+
|
|
390
|
+
switch (type)
|
|
391
|
+
{
|
|
392
|
+
case SystemInterfaceFlags.InitializeSystem:
|
|
393
|
+
systemInfos = systems.InitializeSystemInfos
|
|
394
|
+
.Where(systemInfo => systemInfo.InitializationDuration >= _threshold);
|
|
395
|
+
break;
|
|
396
|
+
case SystemInterfaceFlags.FixedUpdateSystem:
|
|
397
|
+
systemInfos = systems.FixedUpdateSystemInfos
|
|
398
|
+
.Where(systemInfo => systemInfo.AverageFixedUpdateDuration >= _threshold);
|
|
399
|
+
break;
|
|
400
|
+
case SystemInterfaceFlags.UpdateSystem:
|
|
401
|
+
systemInfos = systems.UpdateSystemInfos
|
|
402
|
+
.Where(systemInfo => systemInfo.AverageUpdateDuration >= _threshold);
|
|
403
|
+
break;
|
|
404
|
+
case SystemInterfaceFlags.LateUpdateSystem:
|
|
405
|
+
systemInfos = systems.LateUpdateSystemInfos
|
|
406
|
+
.Where(systemInfo => systemInfo.AverageLateUpdateDuration >= _threshold);
|
|
407
|
+
break;
|
|
408
|
+
case SystemInterfaceFlags.ReactiveSystem:
|
|
409
|
+
systemInfos = systems.ReactiveSystemInfos
|
|
410
|
+
.Where(systemInfo => systemInfo.AverageReactiveDuration >= _threshold);
|
|
411
|
+
break;
|
|
412
|
+
case SystemInterfaceFlags.CleanupSystem:
|
|
413
|
+
systemInfos = systems.CleanupSystemInfos
|
|
414
|
+
.Where(systemInfo => systemInfo.CleanupDuration >= _threshold);
|
|
415
|
+
break;
|
|
416
|
+
case SystemInterfaceFlags.TearDownSystem:
|
|
417
|
+
systemInfos = systems.TearDownSystemInfos
|
|
418
|
+
.Where(systemInfo => systemInfo.TeardownDuration >= _threshold);
|
|
419
|
+
break;
|
|
420
|
+
default:
|
|
421
|
+
throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
systemInfos = GetSortedSystemInfos(systemInfos, _systemSortMethod);
|
|
425
|
+
|
|
426
|
+
var systemsDrawn = 0;
|
|
427
|
+
foreach (var systemInfo in systemInfos)
|
|
428
|
+
{
|
|
429
|
+
if (systemInfo.System is DebugSystems debugSystems)
|
|
430
|
+
{
|
|
431
|
+
if (!ShouldShowSystems(debugSystems, type))
|
|
432
|
+
{
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (EditorGUILayoutTools.MatchesSearchString(systemInfo.SystemName.ToLower(), _systemNameSearchString.ToLower()))
|
|
438
|
+
{
|
|
439
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
440
|
+
{
|
|
441
|
+
var indent = EditorGUI.indentLevel;
|
|
442
|
+
EditorGUI.indentLevel = 0;
|
|
443
|
+
|
|
444
|
+
var wasActive = systemInfo.isActive;
|
|
445
|
+
var areParentsActive = systemInfo.AreAllParentsActive;
|
|
446
|
+
if (areParentsActive)
|
|
447
|
+
{
|
|
448
|
+
systemInfo.isActive = EditorGUILayout.Toggle(systemInfo.isActive, GUILayout.Width(20));
|
|
449
|
+
}
|
|
450
|
+
else
|
|
451
|
+
{
|
|
452
|
+
using (new EditorGUI.DisabledScope(true))
|
|
453
|
+
{
|
|
454
|
+
EditorGUILayout.Toggle(false, GUILayout.Width(20));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
EditorGUI.indentLevel = indent;
|
|
459
|
+
|
|
460
|
+
if (systemInfo.isActive != wasActive)
|
|
461
|
+
{
|
|
462
|
+
if (systemInfo.System is IReactiveSystem reactiveSystem)
|
|
463
|
+
{
|
|
464
|
+
if (systemInfo.isActive)
|
|
465
|
+
{
|
|
466
|
+
reactiveSystem.Activate();
|
|
467
|
+
}
|
|
468
|
+
else
|
|
469
|
+
{
|
|
470
|
+
reactiveSystem.Deactivate();
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
using (new EditorGUI.DisabledScope(!systemInfo.isActive || !areParentsActive))
|
|
476
|
+
{
|
|
477
|
+
var guiStyle = GetSystemStyle(systemInfo, type);
|
|
478
|
+
|
|
479
|
+
switch (type)
|
|
480
|
+
{
|
|
481
|
+
case SystemInterfaceFlags.InitializeSystem:
|
|
482
|
+
DrawSimpleSystemInfoPerformance(
|
|
483
|
+
systemInfo.SystemName,
|
|
484
|
+
systemInfo.InitializationDuration,
|
|
485
|
+
guiStyle);
|
|
486
|
+
break;
|
|
487
|
+
case SystemInterfaceFlags.FixedUpdateSystem:
|
|
488
|
+
DrawDetailedSystemInfoPerformance(
|
|
489
|
+
systemInfo.SystemName,
|
|
490
|
+
systemInfo.AverageFixedUpdateDuration,
|
|
491
|
+
systemInfo.MinFixedUpdateDuration,
|
|
492
|
+
systemInfo.MaxFixedUpdateDuration,
|
|
493
|
+
guiStyle);
|
|
494
|
+
break;
|
|
495
|
+
case SystemInterfaceFlags.UpdateSystem:
|
|
496
|
+
DrawDetailedSystemInfoPerformance(
|
|
497
|
+
systemInfo.SystemName,
|
|
498
|
+
systemInfo.AverageUpdateDuration,
|
|
499
|
+
systemInfo.MinUpdateDuration,
|
|
500
|
+
systemInfo.MaxUpdateDuration,
|
|
501
|
+
guiStyle);
|
|
502
|
+
break;
|
|
503
|
+
case SystemInterfaceFlags.LateUpdateSystem:
|
|
504
|
+
DrawDetailedSystemInfoPerformance(
|
|
505
|
+
systemInfo.SystemName,
|
|
506
|
+
systemInfo.AverageLateUpdateDuration,
|
|
507
|
+
systemInfo.MinLateUpdateDuration,
|
|
508
|
+
systemInfo.MaxLateUpdateDuration,
|
|
509
|
+
guiStyle);
|
|
510
|
+
break;
|
|
511
|
+
case SystemInterfaceFlags.ReactiveSystem:
|
|
512
|
+
DrawDetailedSystemInfoPerformance(
|
|
513
|
+
systemInfo.SystemName,
|
|
514
|
+
systemInfo.AverageReactiveDuration,
|
|
515
|
+
systemInfo.MinReactiveDuration,
|
|
516
|
+
systemInfo.MaxReactiveDuration,
|
|
517
|
+
guiStyle);
|
|
518
|
+
break;
|
|
519
|
+
case SystemInterfaceFlags.CleanupSystem:
|
|
520
|
+
DrawDetailedSystemInfoPerformance(
|
|
521
|
+
systemInfo.SystemName,
|
|
522
|
+
systemInfo.AverageCleanupDuration,
|
|
523
|
+
systemInfo.MinCleanupDuration,
|
|
524
|
+
systemInfo.MaxCleanupDuration,
|
|
525
|
+
guiStyle);
|
|
526
|
+
break;
|
|
527
|
+
case SystemInterfaceFlags.TearDownSystem:
|
|
528
|
+
DrawSimpleSystemInfoPerformance(
|
|
529
|
+
systemInfo.SystemName,
|
|
530
|
+
systemInfo.TeardownDuration,
|
|
531
|
+
guiStyle);
|
|
532
|
+
break;
|
|
533
|
+
default:
|
|
534
|
+
throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
systemsDrawn += 1;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
if (systemInfo.System is DebugSystems debugSystem)
|
|
543
|
+
{
|
|
544
|
+
var indent = EditorGUI.indentLevel;
|
|
545
|
+
EditorGUI.indentLevel += 1;
|
|
546
|
+
systemsDrawn += DrawSystemInfos(debugSystem, type);
|
|
547
|
+
EditorGUI.indentLevel = indent;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
return systemsDrawn;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
private void DrawSimpleSystemInfoPerformance(
|
|
555
|
+
string systemName,
|
|
556
|
+
double duration,
|
|
557
|
+
GUIStyle style)
|
|
558
|
+
{
|
|
559
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
560
|
+
{
|
|
561
|
+
EditorGUILayout.LabelField(systemName, style);
|
|
562
|
+
EditorGUILayout.LabelField(string.Format(DURATION_TIME_FORMAT, duration), style);
|
|
563
|
+
GUILayout.FlexibleSpace();
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
private void DrawDetailedSystemInfoPerformance(
|
|
568
|
+
string systemName,
|
|
569
|
+
double averageDuration,
|
|
570
|
+
double minDuration,
|
|
571
|
+
double maxDuration,
|
|
572
|
+
GUIStyle style)
|
|
573
|
+
{
|
|
574
|
+
const string AVERAGE_FORMAT = "Avg {0:00.000}";
|
|
575
|
+
const string MIN_FORMAT = "▼ {0:00.000}";
|
|
576
|
+
const string MAX_FORMAT = "▲ {0:00.000}";
|
|
577
|
+
|
|
578
|
+
STRING_BUILDER.Clear();
|
|
579
|
+
STRING_BUILDER.Append(string.Format(AVERAGE_FORMAT, averageDuration).PadRight(14));
|
|
580
|
+
STRING_BUILDER.Append(string.Format(MIN_FORMAT, minDuration).PadRight(12));
|
|
581
|
+
STRING_BUILDER.Append(string.Format(MAX_FORMAT, maxDuration));
|
|
582
|
+
|
|
583
|
+
using (new EditorGUILayout.HorizontalScope())
|
|
584
|
+
{
|
|
585
|
+
EditorGUILayout.LabelField(systemName, STRING_BUILDER.ToString(), style);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
private static IEnumerable<SystemInfo> GetSortedSystemInfos(IEnumerable<SystemInfo> systemInfos, SortMethod sortMethod)
|
|
590
|
+
{
|
|
591
|
+
switch (sortMethod)
|
|
592
|
+
{
|
|
593
|
+
case SortMethod.Name:
|
|
594
|
+
return systemInfos.OrderBy(systemInfo => systemInfo.SystemName);
|
|
595
|
+
case SortMethod.NameDescending:
|
|
596
|
+
return systemInfos.OrderByDescending(systemInfo => systemInfo.SystemName);
|
|
597
|
+
case SortMethod.ExecutionTime:
|
|
598
|
+
return systemInfos.OrderBy(systemInfo => systemInfo.AverageUpdateDuration);
|
|
599
|
+
case SortMethod.ExecutionTimeDescending:
|
|
600
|
+
return systemInfos.OrderByDescending(systemInfo => systemInfo.AverageUpdateDuration);
|
|
601
|
+
default:
|
|
602
|
+
return systemInfos;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
private static bool ShouldShowSystems(DebugSystems systems, SystemInterfaceFlags type)
|
|
607
|
+
{
|
|
608
|
+
if (!_hideEmptySystems)
|
|
609
|
+
{
|
|
610
|
+
return true;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
switch (type)
|
|
614
|
+
{
|
|
615
|
+
case SystemInterfaceFlags.InitializeSystem:
|
|
616
|
+
return systems.TotalInitializeSystemsCount > 0;
|
|
617
|
+
case SystemInterfaceFlags.FixedUpdateSystem:
|
|
618
|
+
return systems.TotalFixedUpdateSystemsCount > 0;
|
|
619
|
+
case SystemInterfaceFlags.UpdateSystem:
|
|
620
|
+
return systems.TotalUpdateSystemsCount > 0;
|
|
621
|
+
case SystemInterfaceFlags.LateUpdateSystem:
|
|
622
|
+
return systems.TotalLateUpdateSystemsCount > 0;
|
|
623
|
+
case SystemInterfaceFlags.ReactiveSystem:
|
|
624
|
+
return systems.TotalReactiveSystemsCount > 0;
|
|
625
|
+
case SystemInterfaceFlags.CleanupSystem:
|
|
626
|
+
return systems.TotalCleanupSystemsCount > 0;
|
|
627
|
+
case SystemInterfaceFlags.TearDownSystem:
|
|
628
|
+
return systems.TotalTearDownSystemsCount > 0;
|
|
629
|
+
default:
|
|
630
|
+
return true;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
private GUIStyle GetSystemStyle(SystemInfo systemInfo, SystemInterfaceFlags systemFlag)
|
|
635
|
+
{
|
|
636
|
+
var style = new GUIStyle(GUI.skin.label);
|
|
637
|
+
var color = systemInfo.IsReactiveSystems && EditorGUIUtility.isProSkin
|
|
638
|
+
? Color.white
|
|
639
|
+
: style.normal.textColor;
|
|
640
|
+
|
|
641
|
+
if (systemFlag == SystemInterfaceFlags.FixedUpdateSystem &&
|
|
642
|
+
systemInfo.AverageFixedUpdateDuration >= VisualDebuggingPreferences.SystemWarningThreshold)
|
|
643
|
+
{
|
|
644
|
+
color = Color.red;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
if (systemFlag == SystemInterfaceFlags.UpdateSystem &&
|
|
648
|
+
systemInfo.AverageUpdateDuration >= VisualDebuggingPreferences.SystemWarningThreshold)
|
|
649
|
+
{
|
|
650
|
+
color = Color.red;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (systemFlag == SystemInterfaceFlags.LateUpdateSystem &&
|
|
654
|
+
systemInfo.AverageLateUpdateDuration >= VisualDebuggingPreferences.SystemWarningThreshold)
|
|
655
|
+
{
|
|
656
|
+
color = Color.red;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (systemFlag == SystemInterfaceFlags.ReactiveSystem &&
|
|
660
|
+
systemInfo.AverageReactiveDuration >= VisualDebuggingPreferences.SystemWarningThreshold)
|
|
661
|
+
{
|
|
662
|
+
color = Color.red;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (systemFlag == SystemInterfaceFlags.CleanupSystem &&
|
|
666
|
+
systemInfo.AverageCleanupDuration >= VisualDebuggingPreferences.SystemWarningThreshold)
|
|
667
|
+
{
|
|
668
|
+
color = Color.red;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
style.normal.textColor = color;
|
|
672
|
+
|
|
673
|
+
return style;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
private void AddSystemDurations(DebugSystems systems)
|
|
677
|
+
{
|
|
678
|
+
// OnInspectorGUI is called twice per frame - only add duration once
|
|
679
|
+
if (Time.renderedFrameCount != _lastRenderedFrameCount)
|
|
680
|
+
{
|
|
681
|
+
_lastRenderedFrameCount = Time.renderedFrameCount;
|
|
682
|
+
|
|
683
|
+
// Execute System
|
|
684
|
+
if (_updateSystemMonitorData.Count >= SYSTEM_MONITOR_DATA_LENGTH)
|
|
685
|
+
{
|
|
686
|
+
_updateSystemMonitorData.Dequeue();
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
_updateSystemMonitorData.Enqueue((float)systems.UpdateDuration);
|
|
690
|
+
|
|
691
|
+
// Fixed Update System
|
|
692
|
+
if (_fixedUpdateSystemMonitorData.Count >= SYSTEM_MONITOR_DATA_LENGTH)
|
|
693
|
+
{
|
|
694
|
+
_fixedUpdateSystemMonitorData.Dequeue();
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
_fixedUpdateSystemMonitorData.Enqueue((float)systems.FixedUpdateDuration);
|
|
698
|
+
|
|
699
|
+
// Late Update System
|
|
700
|
+
if (_lateUpdateSystemMonitorData.Count >= SYSTEM_MONITOR_DATA_LENGTH)
|
|
701
|
+
{
|
|
702
|
+
_lateUpdateSystemMonitorData.Dequeue();
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
_lateUpdateSystemMonitorData.Enqueue((float)systems.LateUpdateDuration + +(float)systems.CleanupDuration);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|