Exemple #1
0
 public static void InitAutosave()
 {
     stw1 = new Stopwatch();
     stw1.Start();
     logo = (Texture2D)AssetDatabase.LoadAssetAtPath(logoPath, typeof(Texture2D));
     EditorApplication.update += EditorUpdate;
     AutoSavePreferences.LoadPreferences();
     LoadPreferences();
 }
Exemple #2
0
    void OnGUI()
    {
        EditorGUILayout.BeginHorizontal();
        if (logo != null)
        {
            GUILayout.Label(logo, GUILayout.Width(50));
        }
        EditorGUILayout.BeginVertical();
        bool autosaveEnabled = GUILayout.Toggle(AutoSavePreferences.autosaveEnabled, "Autosave", GUILayout.ExpandWidth(true));

        EditorGUILayout.LabelField("Last saved: " + Math.Floor(stw1.Elapsed.TotalMinutes) + " minutes ago");
        EditorGUILayout.EndVertical();
        EditorGUILayout.EndHorizontal();

        if (GUI.changed)
        {
            AutoSavePreferences.autosaveEnabled = autosaveEnabled;
            AutoSavePreferences.SavePreferences();
        }
    }