当前位置:网站首页>Lua hot update basic grammar
Lua hot update basic grammar
2022-07-03 07:57:00 【qq_ two billion three hundred and eighty-five million seven hun】
1, What is hot update
Hot updates can be done without downloading the client again , Update the content of the game .
2, Why? C# Scripts cannot be updated directly
C# You need to compile before running dll file , This compilation process cannot be completed on mobile platforms
3, What is? AssetBundle
Resource renewal Technology , It is through AssetBundle, We can go through AssetBundle Update game UI, You can also package scripts or other code as resources AssetBundle Then update to the client .
Lua It is a powerful and compact scripting language , Parsing can be run across platforms , And there is no need to compile
4, How to use it Lua Hot update
You can write Lua The parser , Through this parser , You can run the latest Lua Script , Then we write the code that controls the logic of the game Lua Script
5, How to learn hot renewal Technology
1, Study Lua Programming
2, Learn to pass LuaInterface and luanet Conduct Lua and C# Interactive communication
3, Learn to use AssetBundle Update resources
4, Study uLua SimpleFramework
6,Lua What is it
Embedded in the application , Flexible extension and customization for applications ,
Lua There is a simultaneous JIT project , Provides instant compilation on a specific platform .
Luaforwindows
http://luaforwindows.luaforge.net/
( Installable exe file , A whole set of Lua development environment , Yes Lua Interpreter , Reference manual , Examples and libraries , file , And editor )
lua Open under the installation directory SciTE.exe,lua The suffix of the file is .lua, Press down F5 function
7, How to define variables
num= 100
stay Lua Variables defined in are of no type , According to what data is stored , To decide what type
How to add comments
1, Single-line comments -- The comment
2, Multiline comment --[[ Here are the notes ]]--
Lua The types of variables in are as follows :
1,nil Represents empty data , Equate to null
2,boolean Boolean type , Storage true and false
3,string String type , Strings can be expressed in double quotation marks or single quotation marks
4,number Decimal type (Lua There is no integer type in )
5,table Table type
myTable = {34,34,2,342,4}
myTable[3]
We can use type() To get the type of a variable
matters needing attention
All variables defined by default are global , To define a local variable, you need to add a local;
Local variables declared in a code block , At the end of contemporary code block operation , This variable will be released ;
temp= 34
local var = 345
if Usage of sentences
local hp = 40
if hp<=0 then
print("role is die")
elseif hp>=50 then
print("role is good")
else
print("role is bad")
endLoop structure while loop
index = 1
while index<=100 do
print(index)
index=index+1
endLoop structure repeat loop
repeat
print(index)
index=index+1
until index>100for Loop structure
sum = 0
for index = 1,100 do
sum=sum+index
end
print(sum)function ( Method )
function Plus(num1,num2)
return num1+num2
end
res = Plus(34,45)
print(res)
Mathematical operation function
math.abs -- Take the absolute value
math.cos -- Take trigonometric function
math.max
math.maxinteger
math.min
math.random
math.sin
math.sqrt
math.tan
String processing related functions
string.byte
string.char
string.find
sting.format
string.lower
string.sub
string.upper
.. String addition
tostring() Convert a number into a string
tonumber() Convert a string into a number
table surface
stay Lua Medium table similar C# Dictionary in , It's really just a key-value Data structure of key value pair .
1,table The creation of
myTable = {}
Use after the table name {} assignment , Represents an empty table
2,table Assignment
myTable[3]=34 The assignment method when the key is a number
myTable["name"]="taikr" When the key is a string assignment
myTable.name = "siki" When the key is a string assignment
3,table The interview of
myTable[3] When the key is a number , There is only one way to access
myTable.name When the key is a string, there are two ways to access
myTable["name"]
Table related functions
1.table.concat, Connect all the data in the table into a string
2,table.insert, Insert a data into the specified location
3,table.move, mobile data
4,table.pack, Pack it into a watch
5,table.remove, Remove the data from the specified location
6,table.sort, Sort
7,table.unpack, Returns an array , An array of specified ranges
--[[
myTable={}
myTable[1]=34
myTable[3]="sdf"
myTable["name"] = "taikr"
myTable.name = "siki"
print(myTable[1] ,myTable.name,myTable["name"] )
myTable = {name="taikr",age=18,isMan = false}
myTable.school = " Tyco online "
print(myTable.isMan,myTable.school )
]]--
--scores = {34,56,123,6734,23}
--print( scores[1] )
--for index=1,table.getn(scores) do
--print( scores[index] )
--end
--[[
myTable = {name="taikr",age=18,isMan = false}
for index,value in pairs(myTable) do
print(index,value)
end
]]--
myTable = {name="taikr",age=18,isMan = false}
scores = {34,56,123,6734,23}
table.insert( myTable,2,2 ) -- myTable[2]=2
table.remove(scores,3)
table.sort(scores)
print( table.concat(scores))
边栏推荐
- Viz artist advanced script video tutorial -- stringmap use and vertex operation
- Huawei switch: configure Telnet, SSH and web access
- JS to implement publish and subscribe
- [cocos creator] get the resource UUID
- tslib库的移植
- 超限黑客认知
- 创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
- Pat grade a 1029 median
- What is a data type? What is the use of data types?
- static关键字
猜你喜欢

I want to do large screen data visualization application feature analysis

oracle 插入单引号

【LeetCode】2. Valid parentheses · valid parentheses

一篇文章让你读懂-曼彻斯特编码

How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03

How to configure GDAL under idea
![[untitled]](/img/3d/27a7229e3f0ccf0ca5ae1f00a92513.jpg)
[untitled]

方正锐利重磅升级到12.0版本,包装印前处理更加便捷、高效!

Harmonyos third training notes

VMware virtual machine configuration static IP
随机推荐
PHP common sorting algorithm
[MySQL 12] MySQL 8.0.18 reinitialization
[at] ABC 258g - Triangle triples reachable - violence
一条通往服务器所有端口的隧道
Harmonyos third training notes
Demonstration of plug-in use of ventuz basic series
PHP常用排序算法
Technical dry goods Shengsi mindspire dynamic transformer with variable sequence length has been released!
PDO and SDO concepts
Product creation and commercial realization of chat robot (according to La Ma Bang - Dr. Wang Jingjing - speech)
Clip Related Script
Zohocrm deluge function application time verification
华为交换机配置ssh登录远程管理交换机
*p++、*++p、++*p、(*p)++
HDMI2.1与HDMI2.0的区别以及转换PD信号。
vcs import src < ros2. Repos failed
Getting started with minicom
C language learning notes (mind map)
PIP uses image website to solve the problem of slow network speed
P2622 关灯问题II(状态压缩 搜索)