mirror of
https://github.com/godotengine/godot-benchmarks.git
synced 2025-12-31 09:49:13 +03:00
Fix C# benchmarks not being able to load, add ability to change benchmark time limit (#82)
- Allow the benchmark time limit to be changed by C# scripts. - Continuation of #73, fixes a crash when running C# physics benchmarks. Also sets the C# physics benchmarks to 10 seconds. - Fix C# benchmarks not being loaded.
This commit is contained in:
committed by
GitHub
parent
dddd717a4d
commit
cdea241009
@@ -2,6 +2,7 @@ using Godot;
|
||||
|
||||
public partial class Benchmark : RefCounted
|
||||
{
|
||||
public double benchmark_time = 5e6;
|
||||
public bool test_render_cpu = false;
|
||||
public bool test_render_gpu = false;
|
||||
public bool test_idle = false;
|
||||
|
||||
@@ -20,6 +20,7 @@ public partial class RigidBody2D : Benchmark
|
||||
SquareMesh.Size = new Vector2(20.0f, 20.0f);
|
||||
CircleMesh.Radius = 10.0f;
|
||||
CircleMesh.Height = 20.0f;
|
||||
benchmark_time = 10e6;
|
||||
test_physics = true;
|
||||
test_idle = true;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public partial class RigidBody3D : Benchmark
|
||||
|
||||
public RigidBody3D()
|
||||
{
|
||||
benchmark_time = 10e6;
|
||||
test_physics = true;
|
||||
test_idle = true;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ func _ready():
|
||||
set_process(false)
|
||||
|
||||
# Register script language compatibility
|
||||
if Engine.has_singleton("GodotSharp"):
|
||||
if ClassDB.class_exists(&"CSharpScript"):
|
||||
languages[".cs"] = {"test_prefix": "Benchmark"}
|
||||
|
||||
# Register contents of `benchmarks/` folder automatically.
|
||||
|
||||
Reference in New Issue
Block a user