Files
JJBB/Assets/Project/Script/LuaScripts/UI/Lua/Copy/ZiJinYop/LuaReliveBtn.txt
2024-08-23 15:49:34 +08:00

47 lines
1.3 KiB
Plaintext

LuaReliveBtn = {}
require("Util")
require("LuaUtil")
local _zhuchengTimeDown = 5
local _zhuchengBtnPlane
local _zhuchengTime
local _ContentTra
function LuaReliveBtn.Awake( ... )
_zhuchengBtnPlane = zhuchengBtnPlane:GetComponent("Transform")
_zhuchengTime = zhuchengTime:GetComponent("Text")
_ContentTra = _Content:GetComponent("Transform")
_zhuchengBtnPlane.gameObject:SetActive(true)
end
function LuaReliveBtn.OnEnable( ... )
_zhuchengBtnPlane.gameObject:SetActive(false)
_zhuchengTimeDown = 8
end
local tames = 0
function LuaReliveBtn.Update( ... )
if CS.GameManager.gameManager.m_RunningScene == 658 then
if CS.UnityEngine.GameObject.Find("ZIJINEasterCountInfo") ~= nil then
local ZIJINEasterCountInfo = CS.UnityEngine.GameObject.Find("ZIJINEasterCountInfo")
if ZIJINEasterCountInfo:GetComponent("Text").text == "0" then
_ContentTra.transform:GetChild('1').gameObject:SetActive(false)
if _zhuchengTimeDown <= 5 then
_zhuchengBtnPlane.gameObject:SetActive(true)
end
end
end
tames = tames + CS.UnityEngine.Time.deltaTime
if tames >= 1 then
_zhuchengTimeDown = _zhuchengTimeDown - 1
_zhuchengTime.text = _zhuchengTimeDown
tames = 0
end
end
end