Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Rebuild C# Project On Focus

An asset by lewiji
The page banner background of a mountain and forest
Rebuild C# Project On Focus hero image

Quick Information

0 ratings
Rebuild C# Project On Focus icon image
lewiji
Rebuild C# Project On Focus

Mimics the behaviour of another popular C# engine, where if changes to scripts are detected when the editor window is refocused (i.e. due to tabbing in and out of an IDE), the .NET build process is automatically triggered.

Supported Engine Version
4.1
Version String
0.2
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Rebuild C# Project On Focus plugin for Godot 4.x

Mimics Unity style behaviour, where if changes to scripts are detected when the editor window is refocused (i.e. due to tabbing in and out of an IDE), the .NET build process is automatically triggered. Optionally, the "build on run" functionality of the editor can be disabled.

Since the C# BuildManager and related GodotTools classes aren't exposed to scripting, this takes a somewhat hacky approach of grabbing the nodes from the bottom bar, and using the Godot API to identify if any of them has a BuildProject method (indicating it's of (unexposed) type GodotTools.Build.MSBuildPanel) and creating a Callable out of it to trigger the build process.

Feasibly this could be written in gdscript, but since it will be used in .NET projects anyway, it's in C#. Since this functionality is usually desired for [Tool] scripts, using C# it should be possible to add a preference to only rebuild if changes to [Tool] scripts are detected via reflection on the ToolAnnotation type. However, for now there is just a simple on/off checkbox added to the top toolbar.

To use: add the addons/rebuild_cs_on_focus folder to your project, build the solution, and then enable the plugin in Project Settings. Rebuild options can be toggled from the "Rebuild" menu button in the editor toolbar.

Mimics the behaviour of another popular C# engine, where if changes to scripts are detected when the editor window is refocused (i.e. due to tabbing in and out of an IDE), the .NET build process is automatically triggered.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Rebuild C# Project On Focus icon image
lewiji
Rebuild C# Project On Focus

Mimics the behaviour of another popular C# engine, where if changes to scripts are detected when the editor window is refocused (i.e. due to tabbing in and out of an IDE), the .NET build process is automatically triggered.

Supported Engine Version
4.1
Version String
0.2
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers