Stats Monitor - Performance Stats & Graph for Unity

@ciathyza Great, thank you very much for your fast answer !

I like the asset, but it’s too much trouble to integrate into an existing UI.

Hi JTown, can you elaborate a bit more how you want to integrate it into an existing UI? What Stats Monitor does now is basically just laying itself above all other UI so it’s always top-most. I haven’t had a problem with that so far but it would be good to know if there are any UI problems users are encountering with it.

For most people that’s probably fine, but I wanted it at a specific position instead of one of the corners. That was a bit tricky.

Then, the way it handles persistence across scenes is weird. If I remember correctly, it always set itself to do not destroy on load regardless of the state of the corresponding checkbox. Unticking that checkbox in your asset just makes it destroy itself when it loads to simulate normal behavior. So if I have a reference to it (so that users can change or enable on the fly through the existing game input), it gets lost next time I load the scene and it kills itself, so that’s an extra layer of awkwardness to work around.

Finally, I have a pretty complex camera setup and I need all the UI on the same camera so I’d want to have it next to my other UI elements in the hierarchy etc. With the way I’m blitting multiple cameras to the screen, your canvas doesn’t end up showing up when it’s rendered on top (even if I see it in the scene view).

I simply want to position it in the editor along with the rest of my UI and then let my scripts tell it to enable/disable and what mode to run in.

Thanks for the details JTown! As for the positioning, would it work if I add an option to set an arbitrary h/v margin between the Stats Monitor widget and screen corners? That could essentially be used to position the widget anywhere and still be compatible with the screen corner alignment.

The level persistence issue is a bug I will be looking into.

Do you think the last issue could be related to that SM tries to keep itself top-most? That might certainly be a limitation in some cases. I will look deeper into how I can create the canvas integration more flexible.

Hi.

I’m having a bit of a problem with the display on this.

I have 1 camera, and 1 canvas in my scene.

I attach the 2 scripts to an empty object.

If I have the object inside the canvas, I get this. My stuff is displaying ok, but the monitor overlay covers the whole screen.

And if I have the object outside the canvas I get this. Monitor displays ok, but for some reason my stuff is zoomed in on.

Any suggestions gratefully received.

Hi fatlgor. that looks odd! I never encountered this behavior. Did you put Statsmonitor into an object as child under your own canvas object somewhere or is it in root in your scene?

Edit: Can you make a screenshot of your scene displayed in the Scene view while it’s running so that all objects can be seen? And if possible the scene hierarchy? That would help understand what’s going on.

I created an empty ui object (called it StatsMonitorHolder) , and put Statsmonitor and Statsmonitorwrapper in that as two added components.
Then if I put StatsMonitorHolder in the root of the scene, I get it as image 2.
If I put StatsMonitorHolder as a child object inside my canvas object, I get image 1.

I am using RenderMode.WorldSpace, and an orthographic camera. Also I have set the layout to 720x1280 under the Game tab.

I see. Have to check how it behaves when SM is put into another object. So far it hasn’t been intended to be used like that. Is there any important reason for putting Statsmonitorwrapper as child into another object? Also the Stats Monitor objects needs to stay a child of the wrapper for the canvas used by SM to work properly.

OK. I hadn’t noticed the StatsMonitor under the ā€œcreate otherā€ option in the editor. When I do that it works fine.

The failure to find that was why I had been just attaching the scripts to an object.

Thanks for your prompt replies to my attempts to break your plugin through inattention…

Glad to hear it works now for you! I should probably make it more obvious for users to know how to add the monitor to a scene.

will this run on consoles like the ps4 and xbox?

In theory it should but I can’t test it due to lack of those consoles. You’d have to map buttons from the gamepad to toggle the monitor of course.

1 Like

Could you please create a simple example of how to access Stats Monitor settings through C# script ?
I’ve found the API but I can’t get it to work.

Sorry for the delay! To access Stats Monitor’s API you could use something like for example:

            StatsMonitorWidget widget = FindObjectOfType<StatsMonitorWidget>();
            if (widget != null)
            {
                widget.Alignment = SMAlignment.LowerCenter;
                widget.Toggle();
            }

I have a suggestion, could you avoid calling DontDestroyOnLoad when user has unchecked Keep Alive?

I have only one scene (due to procedural nature of my game) and not calling it means I can avoid putting stats monitor in root.

Not a big deal, just a nice to have.

PS: It involves updating StatsMonitor and StatsMonitorWidget. Don’t force DontDestroyOnLoad on awake, and don’t Dispose when _keepAlive is false.

@bitinn Sorry for the late reply! I’ve submitted a new release (1.3.4) that has some updated changes about Keep Alive. This should also solve your change request.

not working on unity 5.6.0f3. When stats monitor is activated unity editor will deadlock in 100% cpu. Please fix it thanks!

1 Like

Is it possible to disable the Touch gestures on Smartphones / Tablets?

@ciathyza I just bought Stats Monitor, but it crashes Unity when I press Play. This happens simply by adding the Status Monitor object to the scene using the menu command. I didn’t modify any settings. This crash also occurs when running a build of the game (with a very similar stacktrace).

I’m running Unity 5.6.0f3 on macOS 10.12.4. Here’s part of the crash report:

Process:               Unity [32497]
Path:                  /Applications/Unity/Unity.app/Contents/MacOS/Unity
Identifier:            com.unity3d.UnityEditor5.x
Version:               Unity version 5.6.0f3 (5.6.0f3)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Unity [32497]
User ID:               501

Date/Time:             2017-04-23 22:11:24.391 -0700
OS Version:            Mac OS X 10.12.4 (16E195)
Report Version:        12
Anonymous UUID:        264ECA25-6141-B923-B180-3DD9586E8FD3

Sleep/Wake UUID:       4601202E-0509-45A7-88C5-FA860CBAC2FC

Time Awake Since Boot: 1900000 seconds
Time Since Wake:       170000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00007fff5f3ffeb8
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x7fff5f3ffeb8:
    Stack                  000070000ef74000-000070000f776000 [ 8200K] rw-/rwx SM=COW  thread 88
--> STACK GUARD            00007fff5bc00000-00007fff5f400000 [ 56.0M] ---/rwx SM=NUL  stack guard for thread 0
    Stack                  00007fff5f400000-00007fff5fc00000 [ 8192K] rw-/rwx SM=PRV  thread 0

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   libmono.0.dylib                   0x000000010b3f86e5 mono_aot_get_class_from_name + 30
1   libmono.0.dylib                   0x000000010b45cbb7 mono_class_from_name + 203
2   libmono.0.dylib                   0x000000010b47a86a mono_exception_from_name_domain + 55
3   libmono.0.dylib                   0x000000010b47aafb mono_exception_from_name_msg + 49
4   com.unity3d.UnityEditor5.x       0x0000000102092c33 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) + 99
5   com.unity3d.UnityEditor5.x       0x00000001020864dd ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 125
6   com.unity3d.UnityEditor5.x       0x0000000102092ddd scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 269
7   com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
8   com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
9   com.unity3d.UnityEditor5.x       0x0000000102086540 ScriptingStringPtr ScriptingInvocation::Invoke<ScriptingStringPtr>(ScriptingExceptionPtr*, bool) + 16
10  com.unity3d.UnityEditor5.x       0x00000001025c5b1c ExtractMonoStacktrace(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, int, core::basic_string<char, core::StringStorageDefault<char> >&, int*, int, int) + 188
11  com.unity3d.UnityEditor5.x       0x0000000101c95caf DebugStringToFile(DebugStringToFileData const&) + 847
12  com.unity3d.UnityEditor5.x       0x0000000101c938fd DebugStringToFile(char const*, int, char const*, int, LogMessageFlags, int, int, void (*)(CppLogEntry const&)) + 93
13  com.unity3d.UnityEditor5.x       0x0000000102092e7d scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 429
14  com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
15  com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
16  com.unity3d.UnityEditor5.x       0x0000000102086540 ScriptingStringPtr ScriptingInvocation::Invoke<ScriptingStringPtr>(ScriptingExceptionPtr*, bool) + 16
17  com.unity3d.UnityEditor5.x       0x00000001025c5b1c ExtractMonoStacktrace(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, int, core::basic_string<char, core::StringStorageDefault<char> >&, int*, int, int) + 188
18  com.unity3d.UnityEditor5.x       0x0000000101c95caf DebugStringToFile(DebugStringToFileData const&) + 847
19  com.unity3d.UnityEditor5.x       0x0000000101c938fd DebugStringToFile(char const*, int, char const*, int, LogMessageFlags, int, int, void (*)(CppLogEntry const&)) + 93
20  com.unity3d.UnityEditor5.x       0x0000000102092e7d scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 429
21  com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
22  com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
23  com.unity3d.UnityEditor5.x       0x0000000102086540 ScriptingStringPtr ScriptingInvocation::Invoke<ScriptingStringPtr>(ScriptingExceptionPtr*, bool) + 16
24  com.unity3d.UnityEditor5.x       0x00000001025c5b1c ExtractMonoStacktrace(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, int, core::basic_string<char, core::StringStorageDefault<char> >&, int*, int, int) + 188
25  com.unity3d.UnityEditor5.x       0x0000000101c95caf DebugStringToFile(DebugStringToFileData const&) + 847
26  com.unity3d.UnityEditor5.x       0x0000000101c938fd DebugStringToFile(char const*, int, char const*, int, LogMessageFlags, int, int, void (*)(CppLogEntry const&)) + 93
27  com.unity3d.UnityEditor5.x       0x0000000102092e7d scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 429
28  com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
29  com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
30  com.unity3d.UnityEditor5.x       0x0000000102086540 ScriptingStringPtr ScriptingInvocation::Invoke<ScriptingStringPtr>(ScriptingExceptionPtr*, bool) + 16
31  com.unity3d.UnityEditor5.x       0x00000001025c5b1c ExtractMonoStacktrace(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, int, core::basic_string<char, core::StringStorageDefault<char> >&, int*, int, int) + 188
32  com.unity3d.UnityEditor5.x       0x0000000101c95caf DebugStringToFile(DebugStringToFileData const&) + 847
33  com.unity3d.UnityEditor5.x       0x0000000101c938fd DebugStringToFile(char const*, int, char const*, int, LogMessageFlags, int, int, void (*)(CppLogEntry const&)) + 93
34  com.unity3d.UnityEditor5.x       0x0000000102092e7d scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 429
35  com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
36  com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
37  com.unity3d.UnityEditor5.x       0x0000000102086540 ScriptingStringPtr ScriptingInvocation::Invoke<ScriptingStringPtr>(ScriptingExceptionPtr*, bool) + 16
38  com.unity3d.UnityEditor5.x       0x00000001025c5b1c ExtractMonoStacktrace(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, int, core::basic_string<char, core::StringStorageDefault<char> >&, int*, int, int) + 188
39  com.unity3d.UnityEditor5.x       0x0000000101c95caf DebugStringToFile(DebugStringToFileData const&) + 847
40  com.unity3d.UnityEditor5.x       0x0000000101c938fd DebugStringToFile(char const*, int, char const*, int, LogMessageFlags, int, int, void (*)(CppLogEntry const&)) + 93
41  com.unity3d.UnityEditor5.x       0x0000000102092e7d scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 429
42  com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
43  com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
44  com.unity3d.UnityEditor5.x       0x0000000102086540 ScriptingStringPtr ScriptingInvocation::Invoke<ScriptingStringPtr>(ScriptingExceptionPtr*, bool) + 16
45  com.unity3d.UnityEditor5.x       0x00000001025c5b1c ExtractMonoStacktrace(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, int, core::basic_string<char, core::StringStorageDefault<char> >&, int*, int, int) + 188
46  com.unity3d.UnityEditor5.x       0x0000000101c95caf DebugStringToFile(DebugStringToFileData const&) + 847
47  com.unity3d.UnityEditor5.x       0x0000000101c938fd DebugStringToFile(char const*, int, char const*, int, LogMessageFlags, int, int, void (*)(CppLogEntry const&)) + 93
48  com.unity3d.UnityEditor5.x       0x0000000102092e7d scripting_stack_trace_info_for(ScriptingExceptionPtr, StackTraceInfo&) + 429
49  com.unity3d.UnityEditor5.x       0x0000000102080b2f Scripting::LogException(ScriptingExceptionPtr, int, char const*) + 223
50  com.unity3d.UnityEditor5.x       0x000000010208650c ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 172
51  com.unity3d.UnityEditor5.x       0x000000010223ef99 UI::RectTransform::smile:eactivate(DeactivateOperation) + 153
52  com.unity3d.UnityEditor5.x       0x00000001017c5f59 GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 1113
53  com.unity3d.UnityEditor5.x       0x00000001017c5d1e GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 542
54  com.unity3d.UnityEditor5.x       0x00000001017c5d1e GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 542
55  com.unity3d.UnityEditor5.x       0x00000001017c5d1e GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 542
56  com.unity3d.UnityEditor5.x       0x00000001017c6da1 GameObject::smile:eactivate(DeactivateOperation) + 129
57  com.unity3d.UnityEditor5.x       0x00000001017c733f GameObject::EnsureUniqueTransform(bool, bool) + 815
58  com.unity3d.UnityEditor5.x       0x0000000101cc3108 AddComponentUnchecked(GameObject&, Unity::Type const*, ScriptingClassPtr, MonoScript*, core::basic_string<char, core::StringStorageDefault<char> >*) + 328
59  com.unity3d.UnityEditor5.x       0x0000000101cc5e16 AddComponent(GameObject&, Unity::Type const*, ScriptingClassPtr, core::basic_string<char, core::StringStorageDefault<char> >*) + 486
60  com.unity3d.UnityEditor5.x       0x00000001019c76e0 MonoAddComponentWithType(GameObject&, ScriptingSystemTypeObjectPtr) + 304
61  ???                               0x00000001356a8a9a 0 + 5191142042
62  ???                               0x00000001356a8947 0 + 5191141703
63  ???                               0x000000013549e1bd 0 + 5189001661
64  ???                               0x000000013549dbbb 0 + 5189000123
65  ???                               0x000000013549cffe 0 + 5188997118
66  ???                               0x000000013549c803 0 + 5188995075
67  ???                               0x000000013549c664 0 + 5188994660
68  ???                               0x0000000124703984 0 + 4906301828
69  ???                               0x000000012470070d 0 + 4906288909
70  ???                               0x0000000119fe75fa 0 + 4731074042
71  libmono.0.dylib                   0x000000010b39b036 0x10b391000 + 41014
72  libmono.0.dylib                   0x000000010b4c5b0e mono_runtime_invoke + 117
73  com.unity3d.UnityEditor5.x       0x00000001020864dd ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 125
74  com.unity3d.UnityEditor5.x       0x00000001025bfc46 MonoBehaviour::CallMethodIfAvailable(int) + 470
75  com.unity3d.UnityEditor5.x       0x00000001025c2e55 MonoBehaviour::AddToManager() + 341
76  com.unity3d.UnityEditor5.x       0x0000000102095f98 AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode) + 120
77  com.unity3d.UnityEditor5.x       0x0000000102095d76 AwakeFromLoadQueue::AwakeFromLoad(AwakeFromLoadMode, bool) + 422
78  com.unity3d.UnityEditor5.x       0x00000001017c6c32 GameObject::Activate() + 194
79  com.unity3d.UnityEditor5.x       0x00000001017c74b4 GameObject::EnsureUniqueTransform(bool, bool) + 1188
80  com.unity3d.UnityEditor5.x       0x0000000101cc3108 AddComponentUnchecked(GameObject&, Unity::Type const*, ScriptingClassPtr, MonoScript*, core::basic_string<char, core::StringStorageDefault<char> >*) + 328
81  com.unity3d.UnityEditor5.x       0x0000000101cc5e16 AddComponent(GameObject&, Unity::Type const*, ScriptingClassPtr, core::basic_string<char, core::StringStorageDefault<char> >*) + 486
82  com.unity3d.UnityEditor5.x       0x00000001019c76e0 MonoAddComponentWithType(GameObject&, ScriptingSystemTypeObjectPtr) + 304
83  ???                               0x00000001356a8a9a 0 + 5191142042
84  ???                               0x00000001356a8947 0 + 5191141703
85  ???                               0x000000013549e1bd 0 + 5189001661
86  ???                               0x000000013549dbbb 0 + 5189000123
87  ???                               0x000000013549cffe 0 + 5188997118
88  ???                               0x000000013549c803 0 + 5188995075
89  ???                               0x000000013549c664 0 + 5188994660
90  ???                               0x0000000124703984 0 + 4906301828
91  ???                               0x000000012470070d 0 + 4906288909
92  ???                               0x0000000119fe75fa 0 + 4731074042
93  libmono.0.dylib                   0x000000010b39b036 0x10b391000 + 41014
94  libmono.0.dylib                   0x000000010b4c5b0e mono_runtime_invoke + 117
95  com.unity3d.UnityEditor5.x       0x00000001020864dd ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 125
96  com.unity3d.UnityEditor5.x       0x00000001025bfc46 MonoBehaviour::CallMethodIfAvailable(int) + 470
97  com.unity3d.UnityEditor5.x       0x00000001025c2e55 MonoBehaviour::AddToManager() + 341
98  com.unity3d.UnityEditor5.x       0x0000000102095f98 AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode) + 120
99  com.unity3d.UnityEditor5.x       0x0000000102095d76 AwakeFromLoadQueue::AwakeFromLoad(AwakeFromLoadMode, bool) + 422
100 com.unity3d.UnityEditor5.x       0x00000001017c6c32 GameObject::Activate() + 194
101 com.unity3d.UnityEditor5.x       0x00000001017c74b4 GameObject::EnsureUniqueTransform(bool, bool) + 1188
102 com.unity3d.UnityEditor5.x       0x0000000101cc3108 AddComponentUnchecked(GameObject&, Unity::Type const*, ScriptingClassPtr, MonoScript*, core::basic_string<char, core::StringStorageDefault<char> >*) + 328
103 com.unity3d.UnityEditor5.x       0x0000000101cc5e16 AddComponent(GameObject&, Unity::Type const*, ScriptingClassPtr, core::basic_string<char, core::StringStorageDefault<char> >*) + 486
104 com.unity3d.UnityEditor5.x       0x00000001019c76e0 MonoAddComponentWithType(GameObject&, ScriptingSystemTypeObjectPtr) + 304
105 ???                               0x00000001356a8a9a 0 + 5191142042
106 ???                               0x00000001356a8947 0 + 5191141703
107 ???                               0x000000013549e1bd 0 + 5189001661
108 ???                               0x000000013549dbbb 0 + 5189000123
109 ???                               0x000000013549cffe 0 + 5188997118
110 ???                               0x000000013549c803 0 + 5188995075
111 ???                               0x000000013549c664 0 + 5188994660
112 ???                               0x0000000124703984 0 + 4906301828
113 ???                               0x000000012470070d 0 + 4906288909
114 ???                               0x0000000119fe75fa 0 + 4731074042
115 libmono.0.dylib                   0x000000010b39b036 0x10b391000 + 41014
116 libmono.0.dylib                   0x000000010b4c5b0e mono_runtime_invoke + 117
117 com.unity3d.UnityEditor5.x       0x00000001020864dd ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 125
118 com.unity3d.UnityEditor5.x       0x00000001025bfc46 MonoBehaviour::CallMethodIfAvailable(int) + 470
119 com.unity3d.UnityEditor5.x       0x00000001025c2e55 MonoBehaviour::AddToManager() + 341
120 com.unity3d.UnityEditor5.x       0x0000000102095f98 AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode) + 120
121 com.unity3d.UnityEditor5.x       0x0000000102095d76 AwakeFromLoadQueue::AwakeFromLoad(AwakeFromLoadMode, bool) + 422
122 com.unity3d.UnityEditor5.x       0x00000001017c6c32 GameObject::Activate() + 194
123 com.unity3d.UnityEditor5.x       0x00000001017c74b4 GameObject::EnsureUniqueTransform(bool, bool) + 1188
124 com.unity3d.UnityEditor5.x       0x0000000101cc3108 AddComponentUnchecked(GameObject&, Unity::Type const*, ScriptingClassPtr, MonoScript*, core::basic_string<char, core::StringStorageDefault<char> >*) + 328
125 com.unity3d.UnityEditor5.x       0x0000000101cc5e16 AddComponent(GameObject&, Unity::Type const*, ScriptingClassPtr, core::basic_string<char, core::StringStorageDefault<char> >*) + 486
126 com.unity3d.UnityEditor5.x       0x00000001019c76e0 MonoAddComponentWithType(GameObject&, ScriptingSystemTypeObjectPtr) + 304
127 ???                               0x00000001356a8a9a 0 + 5191142042
128 ???                               0x00000001356a8947 0 + 5191141703
129 ???                               0x000000013549e1bd 0 + 5189001661
130 ???                               0x000000013549dbbb 0 + 5189000123
131 ???                               0x000000013549cffe 0 + 5188997118
132 ???                               0x000000013549c803 0 + 5188995075
133 ???                               0x000000013549c664 0 + 5188994660
134 ???                               0x0000000124703984 0 + 4906301828
135 ???                               0x000000012470070d 0 + 4906288909
136 ???                               0x0000000119fe75fa 0 + 4731074042
137 libmono.0.dylib                   0x000000010b39b036 0x10b391000 + 41014

Those last groups of frames repeat many times after that. Looks like infinite recursion.

Looking at the code, I determined that the recursion is triggered by the call to AddComponent() in CreateBackground(). Disabling that line eliminates the crash, but nothing is displayed. The code looks correct to me, so this may be a bug in Unity 5.6. Is there a way to work around it?