Quantcast
Channel: Answers by "thelackey3326"
Viewing all articles
Browse latest Browse all 30

Answer by thelackey3326

$
0
0
The EditorWindow class has an Update() method that gets called 100 times per second (Ref: [EditorWindow.Update()][1]). You can use this to track time by adding a float member to your EditorWindow subclass and adding 0.01f seconds to it in the Update method. public class MyEditorWindow : EditorWindow { bool m_supposedToCheckTime = false; float m_time = 0.0f; ... void Update() { if (m_supposedToCheckTime) { m_time += 0.01f; if (m_time >= 3.0f) { //make sure you reset your time m_time = 0.0f; m_supposedToCheckTime = false; //TODO: take action } } } } [1]: http://unity3d.com/support/documentation/ScriptReference/EditorWindow.Update.html

Viewing all articles
Browse latest Browse all 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>