diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-09-01 00:40:59 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-09-01 10:29:52 +0200 |
commit | 9a10701c69f073d3d52764c54a1d008475683858 (patch) | |
tree | 0374c1cb576b7beeeb45ad40b52ce881bf4e6210 /modules/mono/editor/script_templates | |
parent | a5db03efa724b8910281d73576d31cc662b8cc13 (diff) |
C#: Assume 64-bit types when type has no meta
When the C# bindings generator finds a type without meta assume the type
refers to the 64-bit version of the type:
- `float` is converted to `double`
- `int` is converted to `long`
Diffstat (limited to 'modules/mono/editor/script_templates')
4 files changed, 13 insertions, 13 deletions
diff --git a/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs b/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs index 1f5ea7532d..fbad482cf6 100644 --- a/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs +++ b/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs @@ -11,13 +11,13 @@ public partial class _CLASS_ : _BASE_ // Get the gravity from the project settings to be synced with RigidBody nodes. public float gravity = ProjectSettings.GetSetting("physics/2d/default_gravity").AsSingle(); - public override void _PhysicsProcess(float delta) + public override void _PhysicsProcess(double delta) { Vector2 velocity = Velocity; // Add the gravity. if (!IsOnFloor()) - velocity.y += gravity * delta; + velocity.y += gravity * (float)delta; // Handle Jump. if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) diff --git a/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs b/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs index 4e978b7549..abed246a1e 100644 --- a/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs +++ b/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs @@ -11,17 +11,17 @@ public partial class _CLASS_ : _BASE_ // Get the gravity from the project settings to be synced with RigidBody nodes. public float gravity = ProjectSettings.GetSetting("physics/3d/default_gravity").AsSingle(); - public override void _PhysicsProcess(float delta) + public override void _PhysicsProcess(double delta) { Vector3 velocity = Velocity; // Add the gravity. if (!IsOnFloor()) - velocity.y -= gravity * delta; + velocity.y -= gravity * (float)delta; // Handle Jump. if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) - velocity.y = JumpVelocity; + velocity.y = JumpVelocity; // Get the input direction and handle the movement/deceleration. // As good practice, you should replace UI actions with custom gameplay actions. diff --git a/modules/mono/editor/script_templates/Node/default.cs b/modules/mono/editor/script_templates/Node/default.cs index 4c86d1666f..74ece028fc 100644 --- a/modules/mono/editor/script_templates/Node/default.cs +++ b/modules/mono/editor/script_templates/Node/default.cs @@ -11,7 +11,7 @@ public partial class _CLASS_ : _BASE_ } // Called every frame. 'delta' is the elapsed time since the previous frame. - public override void _Process(float delta) + public override void _Process(double delta) { } } diff --git a/modules/mono/editor/script_templates/VisualShaderNodeCustom/basic.cs b/modules/mono/editor/script_templates/VisualShaderNodeCustom/basic.cs index bb482e0d6a..cd335934db 100644 --- a/modules/mono/editor/script_templates/VisualShaderNodeCustom/basic.cs +++ b/modules/mono/editor/script_templates/VisualShaderNodeCustom/basic.cs @@ -20,37 +20,37 @@ public partial class VisualShaderNode_CLASS_ : _BASE_ return ""; } - public override int _GetReturnIconType() + public override long _GetReturnIconType() { return 0; } - public override int _GetInputPortCount() + public override long _GetInputPortCount() { return 0; } - public override string _GetInputPortName(int port) + public override string _GetInputPortName(long port) { return ""; } - public override int _GetInputPortType(int port) + public override long _GetInputPortType(long port) { return 0; } - public override int _GetOutputPortCount() + public override long _GetOutputPortCount() { return 1; } - public override string _GetOutputPortName(int port) + public override string _GetOutputPortName(long port) { return "result"; } - public override int _GetOutputPortType(int port) + public override long _GetOutputPortType(long port) { return 0; } |