Skip to content

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Sep 24, 2024
1 parent 61ffcd5 commit a214fec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/VitalRouter.Unity/Assets/Sandbox/SampleMruby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ public partial class SampleMruby : MonoBehaviour
async UniTask Start()
{
using var context = MRubyContext.Create(Router.Default, new MyCommands());

context.Load("def hoge(x) = x * 100");
var h = context.Evaluate<int>("hoge(7)");

using var script = context.CompileScript(
"3.times { |i| cmd :text, body: \"Hello #{i}\" }\n");
$"loop {{ cmd :text, body: \"Hello #{{state[:counter].to_i}} calculated: {h}\" }}\n");

MapTo(Router.Default);

Expand Down

0 comments on commit a214fec

Please sign in to comment.