Search Issue Tracker

Fix In Review for 2022.1.X

Planned for 2021.1.X, 2021.2.X

Votes

0

Found in

2021.1.16f1

2021.1.21f1

Issue ID

1364443

Regression

Yes

GUIStyle errors are thrown when entering Play mode with docked Profiler and the "Maximize On Play" option Enabled

Profiling

-

To reproduce:

1. Download the attached "ProfilerBug.zip" project and open in Unity
2. Open the "SampleScene" scene
3. Open Profiler window and dock it near Console or anywhere else
4. In Game View enable the "Maximize On Play" option
5. Enter Play mode

Expected Results: Everything works as Expected
Actual Results: Errors are spammed in Console:

"Unable to use a named GUIStyle without a current skin. Most likely you need to move your GUIStyle initialization code to OnGUI
UnityEngine.GUIStyle:op_Implicit (string)
UnityEditorInternal.ProfilerTimelineGUI/Styles:.ctor () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:210)
UnityEditorInternal.ProfilerTimelineGUI:get_styles () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:231)
UnityEditorInternal.ProfilerTimelineGUI:InitializeNativeTimeline () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:2673)
UnityEditorInternal.ProfilerTimelineGUI:Clear () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/ProfilerTimelineGUI.cs:1348)
UnityEditorInternal.Profiling.CPUProfilerModule:Clear () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/CPUProfilerModule.cs:92)
UnityEditorInternal.Profiling.CPUOrGPUProfilerModule:OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPUorGPUProfilerModule.cs:308)
UnityEditorInternal.Profiling.CPUProfilerModule:OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerModules/CPU/CPUProfilerModule.cs:81)
UnityEditor.EditorApplicationLayout:InitPlaymodeLayout () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/EditorApplicationLayout.cs:59)"

Notes:
- This issue appears both on Windows and OSX
- This issue is not reproducible when Profiler is undocked and the "Maximize On Play" option is Enabled/Disabled
- This issue is not reproducible when Profiler is docked and the "Maximize On Play" option is Disabled
- Sometimes Unity on MacOS throws different Errors:

"NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ProfilerWindow.SaveViewSettings () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerWindow.cs:682)
UnityEditor.ProfilerWindow.OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/ProfilerEditor/ProfilerWindow/ProfilerWindow.cs:367)
UnityEditor.EditorApplicationLayout:InitPlaymodeLayout() (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/EditorApplicationLayout.cs:59)"

"IConnectionState was not Disposed! Please make sure to call Dispose in OnDisable of the EditorWindow in which it was used.
UnityEditor.Networking.PlayerConnection.GeneralConnectionState:Finalize () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Networking/PlayerConnection/AttachToPlayerGUI.cs:373)"

Reproducible on Unity 2021.1.16f1, 2021.1.21f1, 2021.2.0b11 and 2022.1.0a8
Not reproducible on Unity 2019.4.30f1, 2020.3.18f1 and 2021.1.15f1
Regression on Unity 2021.1.16f1

Comments (1)

  1. 1143c6ede1698fadfc41a900aa456242?d=mm

    Gaspedal

    Sep 11, 2021 21:11

    Same here with 2021.1.16f
    Even when I create a new empty 3d project and click on "play" , I get this GUI Error Message.
    Seems like a Bug.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.