jemy191 / gdbridge Goto Github PK
View Code? Open in Web Editor NEWPackage to simplify C# -> GDScript interoperability
Home Page: https://www.nuget.org/packages/GDBridge/
License: The Unlicense
Package to simplify C# -> GDScript interoperability
Home Page: https://www.nuget.org/packages/GDBridge/
License: The Unlicense
Hello, I am running into a weird edge case.
When rebuilding my csharp project in my IDE, the godot editor does a cold-reload, and throws this error:
/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs:112 - System.MissingMemberException: Cannot create script instance. The class 'PhantomCamera3DBridge' does not define a parameterless constructor.
at Godot.Bridge.ScriptManagerBridge.CreateManagedForGodotObjectScriptInstance(IntPtr scriptPtr, IntPtr godotObject, godot_variant** args, Int32 argCount) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs:line 146
/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs:112 - System.MissingMemberException: Cannot create script instance. The class 'PhantomCamera3DBridge' does not define a parameterless constructor.
at Godot.Bridge.ScriptManagerBridge.CreateManagedForGodotObjectScriptInstance(IntPtr scriptPtr, IntPtr godotObject, godot_variant** args, Int32 argCount) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs:line 146
Not sure why the editor needs that, but it seems to be because cold-reload calls the default constructors on all .net objects.
Adding this code manually fixes the problem:
public partial class PhantomCamera3DBridge
{
public PhantomCamera3DBridge() : base(null){}
}
so, maybe this should be added to the generated code by default?
This is on Godot 4.2
Just trying to get this working, and noticed the link to the example in the documentation leads to a 404 (still can access it, just the doc has the dead link).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.