require("UnityUtil")
local t={}
--开始界面的跳转
function LG()
print(12312)
SceneManager.LoadScene(0)
end
function t:OnStart()
login=self.log.transform:GetComponent(typeof(UI.Button))
login.onClick:AddListener(LG)
end
return t
2.飞机移动的脚本分数 生命值 实现动态更新
require("UnityUtil")
m={}
--生命值
num=5
--更新分数
scores=0
local down=0
local role=nil
function m:OnStart()
--计分器
self.score=self.score.transform:GetComponent(typeof(UI.Text))
--生命值
self.hp=self.hp.transform:GetComponent(typeof(UI.Text))
--找到当前角色
role=GameObject.Find("Cube")
--显示输了面板
Panel=self.Panel
--显示赢了的面板
WinPanel=self.WinPanel
end
--更新分数
function m:socrepanel(hurt)
-- m.score.text=tostring((tonumber(m.score.text)+hurt))
scores=