unity+ LUA Primer

Source: Internet
Author: User

I believe you've decided to use LUA to do hot updates when you search this article, so here's how to prepare for the Unity+lua environment and a simple primer.


First, download Luainterface

luaforwin https://code.google.com/p/luaforwindows/downloads/list   

Or

Lua http://files.luaforge.net/releases/luainterface/luainterface


Second, use

Create a new unity project, unzip two DLLs into the assets directory, and create a new C # script Test.cs , vs Open script, add Reference (Project submenu reference, right-click Add Reference, browse and find two DLLs, OK), you may need to refresh after adding. In Test.cs, add code

Using Luainterface;
Try compiling, if there is no error, the reference succeeds,

If there is an error, "could not find type or namespace name ' Luainterface '", the target frame needs to be set, and the target frame, project------Properties------is set to full base class libraries, Recompile can be (unexplained, please know the classmate informed).

Third, interaction

The functions in C # are registered to Lua,lua. Registerfunction;

LUA executes the function Lua. Loadfunction

LUA executes the file LUA. LoadFile




unity+ LUA Primer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.