Logo
Explore Help
Sign In
seedlingattempt/godot
1
0
Fork 0
You've already forked godot
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
4d710bf659c0bea5b8f3d6ec65eda047bada0e02
godot/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ScriptBoilerplate.cs

22 lines
415 B
C#
Raw Normal View History

C#: Add initial implementation of source generator for script members This replaces the way we invoke methods and set/get properties. This first iteration rids us of runtime type checking in those cases, as it's now done at compile time. Later it will also stop needing the use of reflection. After that, we will only depend on reflection for generic Godot Array and Dictionary. We're stuck with reflection in generic collections for now as C# doesn't support generic/template specialization. This is only the initial implementation. Further iterations are coming, specially once we switch to the native extension system which completely changes the way members are accessed/invoked. For example, with the native extension system we will likely need to create `UnmanagedCallersOnly` invoke wrapper methods and return function pointers to the engine. Other kind of members, like event signals will be receiving the same treatment in the future.
2021-12-28 23:25:16 +01:00
namespace Godot.SourceGenerators.Sample
{
public partial class ScriptBoilerplate : Godot.Node
{
private NodePath _nodePath;
private int _velocity;
public override void _Process(float delta)
{
_ = delta;
base._Process(delta);
}
public int Bazz(StringName name)
{
_ = name;
return 1;
}
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.1 Page: 97ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API