using UnityEngine; using UnityEditor; using System.Collections; public class TimeControl : EditorWindow { [MenuItem ("L/TimeControl")] public static void ShowTimeControl(){ TimeControl window = (TimeControl)EditorWindow.GetWindow (typeof (TimeControl)); window.titleContent = new GUIContent("Time control"); } void OnGUI () { Time.timeScale = EditorGUILayout.Slider ("Time scale", Time.timeScale, 0.0f, 2.0f); Time.fixedDeltaTime = EditorGUILayout.FloatField ("Fixed time step", Time.fixedDeltaTime); if (GUILayout.Button ("Reset")) { Time.timeScale = 1.0f; Time.fixedDeltaTime = 0.02f; } /*GUILayout.Label ("Base Settings", EditorStyles.boldLabel); myString = EditorGUILayout.TextField ("Text Field", myString); groupEnabled = EditorGUILayout.BeginToggleGroup ("Optional Settings", groupEnabled); myBool = EditorGUILayout.Toggle ("Toggle", myBool);*/ //EditorGUILayout.EndToggleGroup (); } }