92503ae8db
The editor no longer needs to create temporary instances to get the default values. The initializer values of the exported properties are still evaluated at runtime. For example, in the following example, `GetInitialValue()` will be called when first looks for default values: ``` [Export] int MyValue = GetInitialValue(); ``` Exporting fields with a non-supported type now results in a compiler error rather than a runtime error when the script is used.
36 lines
731 B
C#
36 lines
731 B
C#
#pragma warning disable CS0169
|
|
|
|
namespace Godot.SourceGenerators.Sample
|
|
{
|
|
public partial class ScriptBoilerplate : 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;
|
|
}
|
|
|
|
public void IgnoreThisMethodWithByRefParams(ref int a)
|
|
{
|
|
_ = a;
|
|
}
|
|
}
|
|
|
|
partial struct OuterClass
|
|
{
|
|
public partial class NesterClass : RefCounted
|
|
{
|
|
public override object _Get(StringName property) => null;
|
|
}
|
|
}
|
|
}
|