Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Auto Load Unity C# Project

Simple script that automatically loads your C# project when your Unity project is opened!

Instructions

Create a Monobehaviour script called "OpenProject" in an Editor folder of your Unity project. Use the code below and next time your project is loaded, the "Assets/Open C# Project" menu option will be called to open your C# project automatically, saving you all of 2 clicks!! (if it does not you may need to bring the Unity window into focus).

using UnityEditor;

/// <summary>
/// Auto open C# solution on project load! Place in an Editor folder
/// </summary>
[InitializeOnLoad]
public static class OpenProject
{
	static OpenProject()
	{
		// Ensure this runs only once per session.
		if (SessionState.GetBool( "openedproject", false ))
		{
			return;
		}

		SessionState.SetBool( "openedproject", true );

		// Use delayCall to safely execute the menu item after initialization.
		EditorApplication.delayCall += () =>
		{
			EditorApplication.ExecuteMenuItem( "Assets/Open C# Project" );
		};
	}
}

About

Simple script that automatically loads your C# project when your Unity project is opened!

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors