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
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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
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.