托管倒计时

master
罗家炜 2025-06-10 15:06:35 +08:00
parent 0ba87157ef
commit 0e306dc681
12 changed files with 196 additions and 129 deletions

View File

@ -88,8 +88,15 @@ function M:init()
self.PlayerTGTips.displayObject.gameObject:SetActive(false)
end
self.PlayerTGBg = view:GetChild('pb_tuoGuan_Bg')
if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then
self.PlayerTGBg.displayObject.gameObject:SetActive(false)
end
self.PlayerTGBorder = view:GetChild('pb_tuoGuan_Border')
if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then
self.PlayerTGBorder.displayObject.gameObject:SetActive(false)
end
end
function M:IsShowTGTips(isShow, time)
--printlog("isShowisShowisShow==== ",isShow," time ",time)
@ -99,11 +106,23 @@ function M:IsShowTGTips(isShow,time)
if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then
self.PlayerTGTips.displayObject.gameObject:SetActive(isShow)
end
if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then
self.PlayerTGBg.displayObject.gameObject:SetActive(isShow)
end
if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then
self.PlayerTGBorder.displayObject.gameObject:SetActive(isShow)
end
self.currentTime = 0
if isShow then
if self.PlayerTGTips then
self.PlayerTGTips.text = "开启托管剩余时间" .. time .. "s"
end
if self.PlayerTGBg then
self.PlayerTGBg.max = time
end
if self.PlayerTGBorder then
self.PlayerTGBorder.max = time
end
self.totalTime = time
--UpdateBeat:Remove(self.OnUpdate,self)
--UpdateBeat:Add(self.OnUpdate,self)
@ -116,10 +135,8 @@ function M:IsShowTGTips(isShow,time)
--UpdateBeat:Remove(self.OnUpdate,self)
TimerManager.RemoveTimer(self.OnUpdate, self)
end
end
function M:OnUpdate()
--printlog("OnUpdate=====================")
if self.isShowTGTimer then
@ -131,7 +148,12 @@ function M:OnUpdate()
if self.PlayerTGTips then
self.PlayerTGTips.text = "开启托管剩余时间" .. self.totalTime .. "s"
end
if self.PlayerTGBg then
self.PlayerTGBg.value = self.totalTime
end
if self.PlayerTGBorder then
self.PlayerTGBorder.value = self.totalTime
end
if self.totalTime <= 0 then
self.isShowTGTimer = false
if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then
@ -144,7 +166,6 @@ function M:OnUpdate()
self:muShiPlayerUpdate()
end
end
end
function M:FillData(player)
@ -339,9 +360,11 @@ function M:MarkTuoguan()
local com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan')
self:AddMarkToHead(com_tuoguan, 'mark_tuoguan')
end
function M:UnmarkTuoguan()
self:RemoveMarkFromHead('mark_tuoguan')
end
-- 动态的往头像上加载组件
function M:AddMarkToHead(com, key)
if key then
@ -354,6 +377,7 @@ function M:AddMarkToHead(com, key)
com.touchable = false
com.xy = self:GetHeadCenter()
end
-- 动态移除组件
function M:RemoveMarkFromHead(key)
if self[key] then
@ -369,5 +393,4 @@ function M:Destroy()
self.muShiPlayerUpdate = nil
end
return M

View File

@ -25,6 +25,12 @@
"ui://m7iejg46ilon7ias",
"ui://m7iejg46ilon7ibc",
"ui://m7iejg46imp57ihp",
"ui://9n9stu2eprgzf0",
"ui://v0j9abjygq7ms2",
"ui://v0j9abjyp0aisn",
"ui://v0j9abjyp0aism",
"ui://v0j9abjygq7mgx",
"ui://v0j9abjygq7mh1",
"ui://m7iejg46z3847i6m",
"ui://m7iejg46kwi0hk0",
"ui://m7iejg46imp57igy",
@ -42,27 +48,17 @@
"test.device": "720p Phone",
"canvasColor": 10066329,
"auxline2": true,
"doc.activeDoc": "ui://m7iejg46imp57ihp",
"doc.activeDoc": "ui://v0j9abjygq7ms2",
"libview.twoColumn": false,
"libview.expandedNodes": [
"27vd145b",
"s63l0suw",
"/",
"27vd145b",
"/buttons/",
"0khx14ar",
"v0j9abjy",
"/",
"m7iejg46",
"/",
"m7iejg46",
"v0j9abjy",
"/component/",
"m7iejg46",
"/component/Lst_room/",
"m7iejg46",
"/images/",
"m7iejg46",
"/images/allNumber/",
"m7iejg46",
"/mgr/"
"v0j9abjy",
"/images/"
],
"auxline1": true,
"snapToGrid": true,

View File

@ -5,23 +5,23 @@
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
<controller name="3d" pages="0,,1," selected="0"/>
<displayList>
<text id="n76_pady" name="tex_round" xy="707,284" pivot="0.5,0" anchor="true" size="98,39" group="n60_v38k" fontSize="28" color="#cccccc" align="center" text="第1/8局">
<text id="n76_pady" name="tex_round" xy="707,284" pivot="0.5,0" anchor="true" size="100,39" group="n60_v38k" fontSize="28" color="#cccccc" align="center" text="第1/8局">
<gearDisplay controller="state" pages="1,3"/>
<relation target="n77_pady" sidePair="left-right"/>
</text>
<text id="n77_pady" name="remaining_card" xy="545,284" size="90,39" group="n60_v38k" fontSize="28" color="#cccccc" text="剩余72">
<text id="n77_pady" name="remaining_card" xy="545,284" size="92,39" group="n60_v38k" fontSize="28" color="#cccccc" text="剩余72">
<gearDisplay controller="state" pages="3"/>
</text>
<text id="n78_pady" name="txt_remain" xy="617,434" size="174,47" group="n60_v38k" fontSize="40" color="#ffffff" autoSize="shrink" singleLine="true" text="剩 张">
<gearDisplay controller="state" pages="1"/>
</text>
<text id="n79_pady" name="txt_remaincount" xy="704,458" pivot="0.5,0.5" anchor="true" size="58,44" group="n60_v38k" font="Microsoft YaHei" fontSize="40" color="#ffffff" align="center" vAlign="middle" text="80">
<text id="n79_pady" name="txt_remaincount" xy="704,458" pivot="0.5,0.5" anchor="true" size="50,54" group="n60_v38k" font="Microsoft YaHei" fontSize="40" color="#ffffff" align="center" vAlign="middle" text="80">
<gearDisplay controller="state" pages="1"/>
</text>
<component id="n80_pady" name="cardbox" src="gq7m6d" fileName="component/turn/Gcm_box_4.xml" xy="643,311" group="n60_v38k">
<gearDisplay controller="state" pages="1,3"/>
</component>
<group id="n60_v38k" name="n60" xy="545,284" size="246,197" advanced="true">
<group id="n60_v38k" name="n60" xy="545,284" size="246,201" advanced="true">
<gearXY controller="3d" pages="0,1" values="545,284|545,239"/>
<relation target="" sidePair="center-center"/>
</group>

View File

@ -10,7 +10,6 @@
<controller name="ting" pages="0,,1," selected="0"/>
<controller name="text_color" pages="0,,1," selected="0"/>
<displayList>
<text id="n47_nkur" name="tuoguanTips" xy="0,-29" size="302,48" fontSize="22" color="#ff0000" vAlign="middle" autoSize="none" text="开启托管剩余时间"/>
<image id="n28_e54q" name="n28" src="gq7m4a" fileName="Main_style_2/images/head/index_bg_01.png" xy="-1,14" size="100,98" group="n33_e7qn" aspect="true"/>
<component id="n5" name="btn_head" src="gq7m43" fileName="Main_style_2/head/Head.xml" xy="10,24" size="79,79" group="n33_e7qn" aspect="true"/>
<graph id="n32_kba2" name="offLine" xy="4,18" size="90,90" group="n33_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
@ -53,5 +52,11 @@
</text>
<text id="n45_rfcn" name="n45" xy="-3,165" size="48,32" group="n46_rfcn" fontSize="22" color="#512e06" vAlign="middle" text="战绩"/>
<group id="n46_rfcn" name="zhanji" xy="-9,163" size="132,35" advanced="true"/>
<component id="n48_psed" name="pb_tuoGuan_Bg" src="p0aisn" fileName="component/pb_tuoGuan_Bg.xml" xy="10,24" size="79,79">
<ProgressBar value="50" max="100"/>
</component>
<component id="n49_psed" name="pb_tuoGuan_Border" src="p0aism" fileName="component/pb_tuoGuan_Border.xml" xy="14,27" size="72,72" aspect="true">
<ProgressBar max="100"/>
</component>
</displayList>
</component>

View File

@ -57,5 +57,11 @@
</text>
<text id="n49_rfcn" name="n49" xy="-5,153" size="48,32" group="n50_rfcn" fontSize="22" color="#512e06" vAlign="middle" text="战绩"/>
<group id="n50_rfcn" name="zhanji" xy="-11,151" size="132,35" advanced="true"/>
<component id="n52_psed" name="pb_tuoGuan_Bg" src="p0aisn" fileName="component/pb_tuoGuan_Bg.xml" xy="13,12" size="79,79">
<ProgressBar value="77" max="100"/>
</component>
<component id="n53_psed" name="pb_tuoGuan_Border" src="p0aism" fileName="component/pb_tuoGuan_Border.xml" xy="18,14" size="70,70" aspect="true">
<ProgressBar value="77" max="100"/>
</component>
</displayList>
</component>

View File

@ -2,18 +2,18 @@
<component size="98,163" opaque="false" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="0"/>
<controller name="bank" pages="0,,1," selected="0"/>
<controller name="read" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="dismiss_room" pages="0,,1," selected="0"/>
<controller name="piao_niao" pages="0,,1," selected="0"/>
<displayList>
<image id="n28_e54q" name="n28" src="gq7m5p" fileName="images/head/index_bg_01.png" xy="-1,14" size="100,98" group="n33_e7qn" aspect="true"/>
<image id="n28_e54q" name="n28" src="gq7m5p" fileName="font/images/head/index_bg_01.png" xy="-1,14" size="100,98" group="n33_e7qn" aspect="true"/>
<component id="n5" name="btn_head" src="gq7m5q" fileName="component/head/Head.xml" xy="10,24" size="79,79" group="n33_e7qn" aspect="true"/>
<graph id="n32_kba2" name="offLine" xy="4,18" size="90,90" group="n33_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
<gearDisplay controller="offline" pages="1"/>
</graph>
<text id="n37_aawn" name="n37" xy="16,48" size="65,39" group="n33_e7qn" fontSize="30" color="#ffffff" text="离线">
<text id="n37_aawn" name="n37" xy="16,48" size="64,42" group="n33_e7qn" fontSize="30" color="#ffffff" text="离线">
<gearDisplay controller="offline" pages="1"/>
</text>
<image id="n6" name="fangzhu" src="gq7m5t" fileName="images/z02.png" xy="-4,83" group="n33_e7qn">
@ -22,7 +22,7 @@
<image id="n34_u4l2" name="zhuang" src="gq7m5u" fileName="images/z01.png" xy="65,2" group="n33_e7qn">
<gearDisplay controller="bank" pages="1"/>
</image>
<component id="n36_h4ge" name="n36" xy="9,24" group="n33_e7qn" touchable="false">
<component id="n36_h4ge" name="n36" xy="9,24" size="100,100" group="n33_e7qn" touchable="false">
<gearDisplay controller="dismiss_room" pages="1"/>
</component>
<group id="n33_e7qn" name="n33" xy="-4,2" size="113,124"/>
@ -41,5 +41,11 @@
<component id="n39_nip5" name="mask_piao" src="gq7m65" fileName="component/piao_niao/mask_piao.xml" xy="-21,82" touchable="false">
<gearDisplay controller="piao_niao" pages="1"/>
</component>
<component id="n41_p0ai" name="pb_tuoGuan_Bg" src="p0aisn" fileName="component/pb_tuoGuan_Bg.xml" xy="10,24" size="79,79">
<ProgressBar max="100"/>
</component>
<component id="n40_p0ai" name="pb_tuoGuan_Border" src="p0aism" fileName="component/pb_tuoGuan_Border.xml" xy="13,26" size="74,74" aspect="true">
<ProgressBar max="100"/>
</component>
</displayList>
</component>

View File

@ -2,13 +2,13 @@
<component size="104,150" opaque="false" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="0"/>
<controller name="bank" pages="0,,1," selected="0"/>
<controller name="read" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="dismiss_room" pages="0,,1," selected="0"/>
<controller name="piao_niao" pages="0,,1," selected="0"/>
<displayList>
<image id="n32_e7qn" name="n32" src="gq7m5p" fileName="images/head/index_bg_01.png" xy="2,3" size="100,98" group="n37_e7qn" aspect="true"/>
<image id="n32_e7qn" name="n32" src="gq7m5p" fileName="font/images/head/index_bg_01.png" xy="2,3" size="100,98" group="n37_e7qn" aspect="true"/>
<component id="n33_e7qn" name="btn_head" src="gq7m5q" fileName="component/head/Head.xml" xy="13,12" size="79,79" group="n37_e7qn" aspect="true"/>
<graph id="n34_e7qn" name="offLine" xy="7,7" size="90,90" group="n37_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
<gearDisplay controller="offline" pages="1"/>
@ -19,10 +19,10 @@
<image id="n36_e7qn" name="zhuang" src="gq7m5u" fileName="images/z01.png" xy="64,-7" group="n37_e7qn" aspect="true">
<gearDisplay controller="bank" pages="1"/>
</image>
<component id="n39_h4ge" name="n39" xy="12,13" group="n37_e7qn" touchable="false">
<component id="n39_h4ge" name="n39" xy="12,13" size="100,100" group="n37_e7qn" touchable="false">
<gearDisplay controller="dismiss_room" pages="1"/>
</component>
<text id="n40_aawn" name="n40" xy="20,33" size="65,39" group="n37_e7qn" fontSize="30" color="#ffffff" text="离线">
<text id="n40_aawn" name="n40" xy="20,33" size="64,42" group="n37_e7qn" fontSize="30" color="#ffffff" text="离线">
<gearDisplay controller="offline" pages="1"/>
</text>
<group id="n37_e7qn" name="n37" xy="-1,-7" size="113,120"/>
@ -41,5 +41,11 @@
<component id="n44_nip5" name="mask_piao" src="gq7m65" fileName="component/piao_niao/mask_piao.xml" xy="-19,67" touchable="false">
<gearDisplay controller="piao_niao" pages="1"/>
</component>
<component id="n45_p0ai" name="pb_tuoGuan_Bg" src="p0aisn" fileName="component/pb_tuoGuan_Bg.xml" xy="13,12" size="79,79">
<ProgressBar value="50" max="100"/>
</component>
<component id="n46_p0ai" name="pb_tuoGuan_Border" src="p0aism" fileName="component/pb_tuoGuan_Border.xml" xy="15,14" size="72,72">
<ProgressBar max="100"/>
</component>
</displayList>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="108,108" extention="ProgressBar" initName="pb_tuoGuan_Bg">
<displayList>
<image id="n5_psed" name="bar" src="psedso" fileName="images/bg.png" xy="0,0" size="108,108" alpha="0.5" fillMethod="radial360" fillClockwise="false">
<relation target="" sidePair="width-width,height-height"/>
</image>
</displayList>
<ProgressBar titleType="value"/>
</component>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="108,108" extention="ProgressBar" initName="pb_tuoGuan_Border">
<displayList>
<image id="n1_p0ai" name="bar" src="p0aisl" fileName="images/tuoguan.png" xy="-10,-10" size="129,128" fillMethod="radial360" fillClockwise="false" fillAmount="78">
<relation target="" sidePair="width-width,height-height"/>
</image>
<text id="n2_p0ai" name="title" xy="0,2" size="108,108" fontSize="30" color="#ffffff" align="center" vAlign="middle" autoSize="none" text="">
<relation target="" sidePair="width-width,height-height"/>
</text>
</displayList>
<ProgressBar titleType="value"/>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1028,6 +1028,10 @@
<image id="m16msh" name="Rectangle 406.png" path="/component/clearing/clearing1/"/>
<image id="m16msi" name="Rectangle 407.png" path="/component/clearing/clearing1/"/>
<image id="m16msj" name="Group 215.png" path="/component/clearing/clearing1/"/>
<image id="p0aisl" name="tuoguan.png" path="/images/"/>
<component id="p0aism" name="pb_tuoGuan_Border.xml" path="/component/"/>
<component id="p0aisn" name="pb_tuoGuan_Bg.xml" path="/component/"/>
<image id="psedso" name="bg.png" path="/images/"/>
</resources>
<publish name="main_majiang" path="..\wb_unity_pro\Assets\ART\base\main_majiang\ui" packageCount="2"/>
</packageDescription>