C# Class dotBunny.Unity.VSCode

ファイルを表示 Open project: dotBunny/VSCode Class Usage Examples

Private Properties

Property Type Description
AutodetectCodePath string
CallVSCode void
CheckForAutoOpen void
CheckForUpdate void
ClearProjectFiles void
FixUnityPreferences void
GetDebugPort int
InstallUnityDebugger void
MenuOpenProject void
OnOpenedAsset bool
OnPlaymodeStateChanged void
OnScriptReload void
PrintNotFound void
ProgramFilesx86 string
ScrubFile void
ScrubProjectContent string
ScrubSolutionContent string
System_AppDomain_CurrentDomain_DomainUnload void
UpdateLaunchFile void
UpdateUnityPreferences void
VSCode System
VSCodeExists bool
VSCodePreferencesItem void
ValidateMenuOpenProject bool
WriteWorkspaceSettings void

Public Methods

Method Description
SyncSolution ( ) : void

Force Unity To Write Project File

Reflection!

UpdateSolution ( ) : void

Update the solution files so that they work with VS Code

Private Methods

Method Description
AutodetectCodePath ( ) : string

Try to find automatically the installation of VSCode

CallVSCode ( string args ) : void

Call VSCode with arguments

CheckForAutoOpen ( ) : void

Checks whether it should auto-open VSCode

VSCode() gets called on Launch and Run, through IntializeOnLoad https://docs.unity3d.com/ScriptReference/InitializeOnLoadAttribute.html To make sure it only opens VSCode when Unity (re)launches (i.e. opens a project), we compare the launch time, which we calculate using EditorApplication.timeSinceStartup.

CheckForUpdate ( ) : void

Check for Updates with GitHub

ClearProjectFiles ( ) : void

Clear out any existing project files and lingering stuff that might cause problems

FixUnityPreferences ( ) : void

Force Unity Preferences Window To Read From Settings

GetDebugPort ( ) : int

Determine what port Unity is listening for on Windows

InstallUnityDebugger ( ) : void

Manually install the original Unity Debuger

This should auto update to the latest.

MenuOpenProject ( ) : void
OnOpenedAsset ( int instanceID, int line ) : bool
OnPlaymodeStateChanged ( ) : void

Executed when the Editor's playmode changes allowing for capture of required data

OnScriptReload ( ) : void
PrintNotFound ( string path ) : void

Print a error message to the Unity Console about not finding the code executable

ProgramFilesx86 ( ) : string

Get Program Files Path

ScrubFile ( string path ) : void
ScrubProjectContent ( string content ) : string

Remove extra/erroneous data from project file (content).

ScrubSolutionContent ( string content ) : string

Remove extra/erroneous data from solution file (content).

System_AppDomain_CurrentDomain_DomainUnload ( object sender, System e ) : void
UpdateLaunchFile ( ) : void

Update Visual Studio Code Launch file

UpdateUnityPreferences ( bool enabled ) : void

Update Unity Editor Preferences

VSCode ( ) : System

Integration Constructor

VSCodeExists ( string curPath ) : bool

Determines if the current path to the code executable is valid or not (exists)

VSCodePreferencesItem ( ) : void
ValidateMenuOpenProject ( ) : bool
WriteWorkspaceSettings ( ) : void

Write Default Workspace Settings

Method Details

SyncSolution() public static method

Force Unity To Write Project File
Reflection!
public static SyncSolution ( ) : void
return void

UpdateSolution() public static method

Update the solution files so that they work with VS Code
public static UpdateSolution ( ) : void
return void