金特+ XNA(C#)
是否可以使用 jint 操作使用 XNA (C#) 创建的 3D 环境,并向其添加功能环境(再次使用 jint)?
Is it possible to use jint to manipulate a 3D environment created with XNA (C#), and to add functionality to this environment (again using jint)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
作为 Jint 的贡献者,我会推荐您 Jint。 Jint 比 Lua 更简单。此外,我不知道这对于 Lua 是否可行,但你可以给它 .NET 对象并在 javascript 中使用它们(Jint 代表 Javascript INTpreter)。您还可以使用权限集来保护您的应用程序。这是之前使用 Jint 提供的相同代码:
As a contributor to Jint, I would recommend you Jint. Jint makes it more simple than what Lua does. Moreover, I don't know if this is possible with Lua, but you can give it .NET objects and play with them in javascript (Jint stands for Javascript INTpreter). You can also secure your application with Permissions Set. Here is the same code provided before with Jint :
Jint 是一个选项,LUA 是一个选项,请查看 LuaForge
LUA 非常有趣且易于使用语言,对协作多任务处理(协程)有很好的支持。它的基本数据类型是表(它是字典和数组的交叉),非常灵活和强大。
这是我刚刚写的东西,只是为了测试一下。我正在为名为
GTest
的脚本注册一个函数,该函数映射到我的对象中名为LUA_GTest
的 C# 方法。该方法接受一个通用对象,在脚本中我向它传递一个表,其中包含一个表示双精度值的字符串的表。在 C# 中,我展开所有内容并返回基于双精度值的值。Jint is an option, LUA is an option check out LuaForge
LUA is a really fun and easy to use language, with nice support for cooperative multitasking (coroutines). Its basic data type is a table (which is a cross between a dictionary and an array) which is very flexible and powerful.
Here's something I wrote up just now just to test it. I am registering a function for the script called
GTest
which maps to a C# method in my object calledLUA_GTest
. The method accepts a general object, and in the script I'm passing to it a table containing a table containing a string representing a double. In C# i'm unwrapping everything and returning a value based on the double value.看一下 这个 SO 问题,考虑如何选择 .Net 脚本平台。
一般来说,您可以在 XNA 应用程序中构建脚本引擎。使用脚本引擎并向应用程序提供挂钩与通过公共接口调用外部程序集没有太大区别。
Take a look at this SO question, considering how to choose a scripting platform for .Net.
In general, sure you can build a scripting engine into your XNA application. Using a scripting engine and providing hooks into your app is not much different than calling external assemblies through public interfaces.