Data interaction method between Lua language and Unity

A data interaction and language technology, applied in the field of data interaction, can solve problems such as game performance impact and cumbersome development process, and achieve the effects of simplifying variable declaration and use process, convenient support, and convenient use
CN112579062AActive Publication Date: 2021-03-30厦门极致互动网络技术股份有限公司

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
厦门极致互动网络技术股份有限公司
Publication Date
2021-03-30

Smart Images

  • Figure 1
    Figure 1
Patent Text Reader

Abstract

The invention discloses a data interaction method between Lua language and Unity, which comprises the following steps: S1, defining the type of a Lua variable, converting the Lua variable into a Lua code in a fixed format, and writing the Lua code into a Lua script file mounted on a C# intermediary component; S2, automatically assigning values to Lua variables, and storing the Lua variables into adata container in the C# intermediary component; S3, automatically serializing the data in the data container; S4, by the C# intermediary component, deserializing all the serialized data collected inthe data container and assembling the serialized data into a LuaTable type variable which can be recognized by a Lua language; and S5, by the C# intermediary component, initializing the Lua script file, and transmitting the LuaTable type variable to the Lua script file for use of the transmitted variable. According to the method, data interaction between Lua and Unity is realized through the C# intermediary component, variable declaration and use processes of the Lua language are greatly simplified, and meanwhile, the game performance of the Lua language when the Unity object is used is improved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the field of computer technology, in particular to a data interaction method between Lua language and Unity. Background technique

[0002] Unity engine game hot update is an important technology for online games on mobile platforms. The existing Unity game engine provides the C# language to interact with Unity objects: C# declares variables, drags and binds or edits objects under the Unity editor. Unlike the C# language natively supported by the Unity engine, Unity does not provide variable binding support for the Lua language, including Lua variable identification, editing, storage, and use processes. In game development, Lua language interacts with Unity objects and components. You can only call the C# interface "Find" (query) and "GetComponent" (get object) provided by Unity to obtain objects or components, which makes the development process cumbersome, and game performance will also be affected during frequent object calls...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More