TimeSinceOpened

From Unify Community Wiki
Revision as of 19:06, 2 September 2013 by Create3dgames (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This script allows you to see how long the current Unity editor window has been open for.

Place this script in your Editor folder.


TimeSinceEditorOpened.js

// add menu item to Unity menu
@MenuItem ("Window/Time Since Editor Opened")
 
// this static function is run when menu item is clicked
static function TimeSinceEditorOpened ()
{
	// variables for time in form of minutes and hours
	var minutes = EditorApplication.timeSinceStartup/60;
	var hours = EditorApplication.timeSinceStartup/3600;
	// display dialog telling user amount of time Unity has been open
	EditorUtility.DisplayDialog ("Time", "This Unity Editor has been open for " + minutes.ToString("f0") + " minutes" + ", which is about " + hours.ToString("f1") + " hours" + ".", "OK", "");
 
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox