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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.