Created
January 15, 2020 15:38
-
-
Save SiarheiPilat/df5be47b449862c62b303c40c76bb784 to your computer and use it in GitHub Desktop.
Turns Auto Refresh option (script recompilation, domain reload) on and off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class ScriptAutoRefreshControl : MonoBehaviour | |
{ | |
/// <summary> | |
/// Turns Auto Refresh option on and off (it is about script recompilation, domain reload). | |
/// Same as going to Edit -> Preferences -> General and changing Auto Refresh option. | |
/// </summary> | |
[MenuItem("Tools/Auto Refresh")] | |
static void SwitchAutomaticScriptCompilation() | |
{ | |
EditorPrefs.SetBool("kAutoRefresh", EditorPrefs.GetBool("kAutoRefresh") ? false : true); | |
//UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); need to repaint prefrences window here! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment