Noirand

MoonSharp メモ

Apr 9th, 2016
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. ◆ MoonSharp のコルーチンについて:
  2. http://www.moonsharp.org/coroutines.html
  3.  
  4. ◆ Lua の関数を C# 側から呼び出す
  5. Script m_Lua = new Script();
  6. m_Lua.DoFile(luafile);
  7. DynValue func = m_Lua.Call(m_Lua.Globals[関数名], 引数);
  8. http://www.moonsharp.org/callback.html
  9.  
  10. ◆ Lua ファイルをコルーチンとして C# から呼び出す
  11. Script m_Lua = new Script();
  12. DynValue m_Func = m_Lua.DoFile(luaFile);
  13. DynValue m_LuaCor = m_Lua.CreateCoroutine(m_Func);
  14. foreach (DynValue x in m_LuaCor.Coroutine.AsTypedEnumerable())
  15. {
  16. ...
  17. }
  18.  
  19. ◆ Lua の任意の関数をコルーチンとして C# から呼び出す
  20. Script m_Lua = new Script();
  21. m_Lua.DoFile(luaFile);
  22. DynValue m_Func = m_Lua.Globals.Get("func");
  23. DynValue m_LuaCor = m_Lua.CreateCoroutine(m_Func);
  24. foreach (DynValue x in m_LuaCor.Coroutine.AsTypedEnumerable())
  25. {
  26. ...
  27. }
  28.  
  29. ◆ C# の関数を Lua 側から呼び出す
  30. http://www.moonsharp.org/objects.html
  31.  
  32. ◆ C# の Enum を Lua で使う
  33. https://groups.google.com/forum/#!searchin/moonsharp/enum/moonsharp/ZA3aIIeyyMs/wh6asehcHAAJ
Add Comment
Please, Sign In to add comment