Search Issue Tracker
Fixed
Votes
1
Found in
4.5.0b6
Issue ID
600361
Regression
No
EditorApplication.Update frequency varies from too fast to too slow
To reproduce:
1. Create a new C# script and paste in:
using UnityEngine;
using UnityEditor;
using System.Collections;
[InitializeOnLoad]
class Test {
static Test() {
EditorApplication.update += OnUpdate;
}
private static int s_Counter = 0;
//private static float s_Tim = 0;
private static void OnUpdate() {
// s_Tim = Time.deltaTime;
if (+s_Counter == 200) {
s_Counter = 0;
Debug.Log("Tick");
//s_Tim = 0;
}
}
}
It prints out a tick after every 200 updates. After first looking into the console you should notice that it seems quite fast - a lot faster than the stated 100 updates per second in the documentation.
2. Uncomment the comments in the script and add + s_Tim.toString() to the debug log. The updates slow down
3. Enter play mode - you should notice that the time value is always the same (for me it was 4 seconds, which is half the speed in the documentation)
4. Comment the time counting parts again - the slow speed still remains
Basically there are some weird inconsistencies, most likely they are by design, but more accurate notes in the documentation would be nice
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Text overlap and is unreadable in Inspector > Terrain Paint Texture after creating new Terrain Layer
- Event "XRInputSubsystem.trackingOriginUpdated" triggers twice when recentering the view
- UITK TextField value is overwritten incorrectly by the converter result when Binding Mode is set to "To Source"
- Out of memory crash when selecting more than 80000 Assets simultaneously
- UI Toolkit Button text is not rendered when the Button has fixed height with specific Icon font
DonCornholio
Aug 03, 2022 13:53
In Unity 2021.3.2 this issue still persists !
awesomedata
Apr 02, 2018 13:33
We really need this fix for our Asset -- it relies on realtime input using the EditorApplication.update delegate -- PLEASE FIX THIS.