-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathExample4.cs
More file actions
55 lines (51 loc) · 1.15 KB
/
Example4.cs
File metadata and controls
55 lines (51 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Puerts;
using XLua;
/// <summary>
/// 静态方法调用
/// 逻辑: 无
/// 参数: 三个值类型参数
/// 返回值: 无
/// </summary>
[Test]
[TestGroup("ParameterCompare")]
public class Example4 : IExecute
{
public bool Static => true;
public string Method => "void Payload(int, int, float);";
public CallTarget Target => CallTarget.ScriptCallCSharp;
public object RunCS(int count)
{
for (var i = 0; i < count; i++)
{
Example4.Payload(i, i + 1, i + 2f);
}
return null;
}
public object RunJS(JsEnv env, int count)
{
env.Eval(string.Format(
@"(function() {{
var Example = require('csharp').Example4;
for(let i = 0; i < {0}; i++){{
Example.Payload(1, i + 1, i + 2);
}}
}})()", count));
return null;
}
public object RunLua(LuaEnv env, int count)
{
env.DoString(string.Format(
@"
(function()
local Example = CS.Example4;
for i = 1,{0} do
Example.Payload(1, i + 1, i + 2);
end
end)()
", count));
return null;
}
public static void Payload(int param1, int param2, float param3)
{
}
}