Skip to content

Instantly share code, notes, and snippets.

@sailro
Created January 4, 2016 22:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sailro/3f9aac4a4145b345c5e9 to your computer and use it in GitHub Desktop.
Save sailro/3f9aac4a4145b345c5e9 to your computer and use it in GitHub Desktop.
Enable/disable VSTU console logs
/*
With the native integration we don’t have a menu to setup options anymore. That’s because the majority of VSTU options are now
directly available within Unity project settings.
But this is not the case for the console redirection.
You should do something like this with an Editor script to properly setup what you want: (only once, this setting is global).
*/
using UnityEngine;
using SyntaxTree.VisualStudio.Unity.Bridge.Configuration;
using UnityEditor;
public class Configuration : MonoBehaviour {
[MenuItem("VSTU/Enable or Disable SendConsoleToVisualStudio")]
static void SwitchSendConsoleToVisualStudio()
{
var cfg = Configurations.Active;
var status = (cfg.SendConsoleToVisualStudio = !cfg.SendConsoleToVisualStudio) ? "enabled" : "disabled";
EditorUtility.DisplayDialog("VSTU", "SendConsoleToVisualStudio is now " + status, "OK", "");
}
}
@ZahlGraf
Copy link

Hi, thanks for that script. Which license does it have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment