【御剑行】提交
parent
99d80454f5
commit
359ca6b299
Binary file not shown.
Before Width: | Height: | Size: 607 KiB After Width: | Height: | Size: 653 KiB |
|
@ -32,7 +32,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3631581760418750615}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
|
@ -153,7 +153,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &3080987045322406410
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -172,7 +172,7 @@ RectTransform:
|
|||
- {fileID: 1252800773484876256}
|
||||
- {fileID: 4679015605071576018}
|
||||
m_Father: {fileID: 3631581760418750615}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
|
@ -731,6 +731,82 @@ MonoBehaviour:
|
|||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &2352408927846721886
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3558052596352230989}
|
||||
- component: {fileID: 2480976253453051851}
|
||||
- component: {fileID: 5693792436182951150}
|
||||
m_Layer: 5
|
||||
m_Name: Waiting
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3558052596352230989
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2352408927846721886}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 7578635766400575642}
|
||||
- {fileID: 13127526796400395}
|
||||
m_Father: {fileID: 3631581760418750615}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2480976253453051851
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2352408927846721886}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &5693792436182951150
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2352408927846721886}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.78431374}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &2813841071853475010
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1232,8 +1308,9 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 6311474299324585906}
|
||||
- {fileID: 5206840635849200025}
|
||||
- {fileID: 1662749411767565241}
|
||||
- {fileID: 3558052596352230989}
|
||||
- {fileID: 5206840635849200025}
|
||||
- {fileID: 3080987045322406410}
|
||||
- {fileID: 53418342384090642}
|
||||
m_Father: {fileID: 0}
|
||||
|
@ -1407,6 +1484,85 @@ MonoBehaviour:
|
|||
isPlayAudio: 1
|
||||
isHaveCloseBtn: 0
|
||||
isPlayOnOpen: 1
|
||||
--- !u!1 &4197915216294855767
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7578635766400575642}
|
||||
- component: {fileID: 3997227958175510498}
|
||||
- component: {fileID: 6424209467759585151}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7578635766400575642
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4197915216294855767}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3558052596352230989}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 500, y: 200}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3997227958175510498
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4197915216294855767}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6424209467759585151
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4197915216294855767}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.78431374}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 6fa15837529b0e640af6620b07d3207d, type: 3}
|
||||
m_FontSize: 100
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 0
|
||||
m_MaxSize: 100
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 1
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u7ED3\u7B97\u4E2D..."
|
||||
--- !u!1 &5099154384626080439
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1697,7 +1853,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3631581760418750615}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
|
@ -2741,7 +2897,7 @@ RectTransform:
|
|||
- {fileID: 7246928682069637843}
|
||||
- {fileID: 6904406165868908363}
|
||||
m_Father: {fileID: 3631581760418750615}
|
||||
m_RootOrder: 4
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
|
@ -2810,6 +2966,85 @@ RectTransform:
|
|||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7878023204108629785
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 13127526796400395}
|
||||
- component: {fileID: 5513397213598594619}
|
||||
- component: {fileID: 282863004183815134}
|
||||
m_Layer: 5
|
||||
m_Name: time
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &13127526796400395
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7878023204108629785}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3558052596352230989}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -76}
|
||||
m_SizeDelta: {x: 500, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5513397213598594619
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7878023204108629785}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &282863004183815134
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7878023204108629785}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.78431374}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 6fa15837529b0e640af6620b07d3207d, type: 3}
|
||||
m_FontSize: 40
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 0
|
||||
m_MaxSize: 100
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 1
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
--- !u!1 &8376062215083992391
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -2888,7 +3123,7 @@ MonoBehaviour:
|
|||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 1
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u4ECA\u65E5\u53EF\u7CBE\u5F69\u6B21\u6570\uFF1A3\u6B21"
|
||||
m_Text: "\u4ECA\u65E5\u53EF\u7ADE\u731C\u6B21\u6570\uFF1A3\u6B21"
|
||||
LanguageIndex: 0
|
||||
--- !u!1 &8381890729594528818
|
||||
GameObject:
|
||||
|
|
|
@ -512,4 +512,8 @@ GameEvent = {
|
|||
LikeAbility = {
|
||||
RefreshRemainTimes = "LikeAbility.RefreshRemainTimes",
|
||||
},
|
||||
--御剑行
|
||||
YuJianXing = {
|
||||
GameFinished = "YuJianXing.GameFinished",
|
||||
},
|
||||
}
|
|
@ -1057,7 +1057,7 @@ function this:TabBtnAction(id,actType,data)
|
|||
local id = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.YuJianXing)
|
||||
NetManager.RidingSwardActivityRequest(id.activityId,function()
|
||||
if YuJianXingManager.curState == 1 or YuJianXingManager.curState == 2 then
|
||||
UIManager.OpenPanel(UIName.YuJianXingPanel,id)
|
||||
SwitchPanel.OpenPanel(UIName.YuJianXingPanel,nil,id)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -57,19 +57,9 @@ end
|
|||
|
||||
--加载玩家
|
||||
function RiceCtrlView:SetPlayer()
|
||||
for i = 1, 4 do--#playerDataList do
|
||||
for i = 1, 4 do
|
||||
self.playerRoadList[i] = {}
|
||||
local data
|
||||
if i == 1 then
|
||||
data = playerDataList.Line1
|
||||
elseif i == 2 then
|
||||
data = playerDataList.Line2
|
||||
elseif i == 3 then
|
||||
data = playerDataList.Line3
|
||||
elseif i == 4 then
|
||||
data = playerDataList.Line4
|
||||
end
|
||||
self.playerRoadList[i] = SubUIManager.Open(SubUIConfig.PlayerRiceView,self.roadList.transform,i,data)
|
||||
self.playerRoadList[i] = SubUIManager.Open(SubUIConfig.PlayerRiceView,self.roadList.transform,i,playerDataList.Result[i])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
local RiceSinglePlayerView = {}
|
||||
local initSpeed = 20
|
||||
local length = 10000
|
||||
local speedValue = {
|
||||
[1] = 1.2,
|
||||
[2] = 0.9
|
||||
}
|
||||
local RidingSwardSence = ConfigManager.GetConfig(ConfigName.RidingSwardSence)
|
||||
|
||||
function RiceSinglePlayerView:New(gameObject)
|
||||
|
@ -12,7 +17,7 @@ end
|
|||
|
||||
function RiceSinglePlayerView:InitComponent()
|
||||
self.spLoader = SpriteLoader.New()
|
||||
self.gameObject:GetComponent("RectTransform").sizeDelta = Vector2.New(10000,100)
|
||||
self.gameObject:GetComponent("RectTransform").sizeDelta = Vector2.New(12500,100)
|
||||
self.player = Util.GetGameObject(self.gameObject,"Root")
|
||||
self.playerRoot = Util.GetGameObject(self.gameObject,"Player")
|
||||
self.playerLiveRoot = Util.GetGameObject(self.player,"Live")
|
||||
|
@ -81,7 +86,7 @@ end
|
|||
function RiceSinglePlayerView:OnUpdate()
|
||||
if self.isRunning then
|
||||
--暂定8500结束游戏
|
||||
if self.curPosX >= 8500 then
|
||||
if self.curPosX >= length then
|
||||
YuJianXingManager.FinishResetGame()
|
||||
else
|
||||
self.curPosX = self.curPosX + self.speed
|
||||
|
@ -89,11 +94,7 @@ function RiceSinglePlayerView:OnUpdate()
|
|||
--事件
|
||||
for i,v in ipairs(self.keyFrameList) do
|
||||
if self.curPosX >= v.pos then
|
||||
if v.value == 1 then--加速
|
||||
self.speed = self.speed*1.2
|
||||
elseif v.value == 2 then--减速
|
||||
self.speed = self.speed*0.9
|
||||
end
|
||||
self.speed = self.speed*speedValue[v.value]
|
||||
destroy(self.keyFrameList[i].obj)
|
||||
table.remove( self.keyFrameList,i)
|
||||
end
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
YuJianXingManager = {}
|
||||
local this = YuJianXingManager
|
||||
local riceCtrl = require("Modules/YuJianXing/RiceCtrlView")
|
||||
local bgList = {"y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg"}
|
||||
local bgList = {"y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg"}
|
||||
|
||||
function this.Initialize()
|
||||
this.curState = 0 --当前比赛状态
|
||||
this.nextTimeCount = 0 --下轮开始时间
|
||||
this.activityTimeCount = 0 --活动倒计时
|
||||
this.nextSession = 0 --当前比赛场次
|
||||
this.curResultId = 1 --当前剧本Id
|
||||
this.curResult = {} --上一场剧本时间和Id
|
||||
this.curRecordList = 0 --当前纪录数据
|
||||
this.curBetList = 0 --当前竞猜数据
|
||||
this.InWaiting = false
|
||||
this.CloseMap()
|
||||
end
|
||||
|
||||
--初始化地图
|
||||
function this.OpenMap()
|
||||
local playerData = ConfigManager.GetConfigDataByKey(ConfigName.RidingSwardResult,"Id",this.curResultId)
|
||||
local playerData = ConfigManager.GetConfigDataByKey(ConfigName.RidingSwardResult,"Id",this.curResult.rankId)
|
||||
if not this.riceCtrl then
|
||||
this.riceCtrl = riceCtrl:New()
|
||||
this.riceCtrl:Awake(bgList,playerData)
|
||||
|
@ -35,12 +36,22 @@ function this.CloseMap()
|
|||
end
|
||||
end
|
||||
|
||||
--重新请求数据
|
||||
function this.ReGetInfo(func)
|
||||
local id = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.YuJianXing)
|
||||
NetManager.RidingSwardActivityRequest(id.activityId,func)
|
||||
end
|
||||
|
||||
--更新服务器界面信息
|
||||
function this.UpdataServerPanelData(msg,func)
|
||||
this.curState = msg.state--当前状态
|
||||
this.nextTime = msg.time--下一场倒计时
|
||||
if msg.state == 1 then
|
||||
this.InWaiting = false
|
||||
end
|
||||
this.nextTimeCount = msg.time/1000--下一场倒计时
|
||||
this.modelList = msg.modelInfo--玩家模板信息
|
||||
this.activityTimeCount = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.YuJianXing).endTime
|
||||
this.curResult = msg.lastRank
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
|
@ -62,7 +73,8 @@ end
|
|||
--游戏结束 重置
|
||||
function this.FinishResetGame()
|
||||
Timer.New(function ()
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.YuJianLastResult)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.YuJianXing.GameFinished)
|
||||
this.InWaiting = true
|
||||
this.ResetGame()
|
||||
end,0.3):Start()
|
||||
end
|
||||
|
|
|
@ -27,6 +27,9 @@ function YuJianXingPanel:InitComponent()
|
|||
self.countText2 = Util.GetGameObject(self.countFrame, "Text2")
|
||||
self.countText3 = Util.GetGameObject(self.countFrame, "Text3")
|
||||
self.countText4 = Util.GetGameObject(self.countFrame, "Text4")
|
||||
--waiting
|
||||
self.waiting = Util.GetGameObject(self.gameObject, "Waiting")
|
||||
self.waitTime = Util.GetGameObject(self.waiting, "time"):GetComponent("Text")
|
||||
|
||||
--testBtn
|
||||
self.start = Util.GetGameObject(self.gameObject, "Button (4)")
|
||||
|
@ -41,8 +44,10 @@ end
|
|||
--绑定事件(用于子类重写)
|
||||
function YuJianXingPanel:BindEvent()
|
||||
Util.AddOnceClick(self.backBtn,function ()
|
||||
SwitchPanel.OpenPanel(nil,function ()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end)
|
||||
|
||||
Util.AddOnceClick(self.helpBtn,function ()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.QiJieShiLian,self.helpPosition.x,self.helpPosition.y)
|
||||
|
@ -78,10 +83,12 @@ end
|
|||
|
||||
--添加事件监听(用于子类重写)
|
||||
function YuJianXingPanel:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.YuJianXing.GameFinished, self.Refresh,self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function YuJianXingPanel:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.YuJianXing.GameFinished, self.Refresh,self)
|
||||
end
|
||||
|
||||
function YuJianXingPanel:OnSortingOrderChange()
|
||||
|
@ -99,6 +106,7 @@ function YuJianXingPanel:OnShow()
|
|||
end
|
||||
|
||||
function YuJianXingPanel:Refresh()
|
||||
self.waiting:SetActive(YuJianXingManager.InWaiting)
|
||||
--为小人在地图上下移动做处理
|
||||
self.count = 0
|
||||
self:SetTime()
|
||||
|
@ -133,7 +141,7 @@ function YuJianXingPanel:StartAnimation()
|
|||
self.countbg:SetActive(false)
|
||||
self.countText4:SetActive(false)
|
||||
self.countFrame:SetActive(false)
|
||||
-- coroutine.wait(0.3)
|
||||
--开始游戏
|
||||
YuJianXingManager.SetGameState(true)
|
||||
end)
|
||||
end
|
||||
|
@ -146,7 +154,11 @@ function YuJianXingPanel:SetTime()
|
|||
local activityEnd = YuJianXingManager.activityTimeCount - GetTimeStamp()
|
||||
local roundEnd = YuJianXingManager.nextTimeCount - GetTimeStamp()
|
||||
self.curActTime.text = string.format("本期活动倒计时:%s",TimeToDHM(activityEnd))
|
||||
if YuJianXingManager.curState == 1 then
|
||||
self.nextRoundTime.text = string.format("下一轮倒计时:%s",TimeToMS(roundEnd))
|
||||
elseif YuJianXingManager.curState == 2 then
|
||||
self.nextRoundTime.text = string.format("比赛进行中···")
|
||||
end
|
||||
self.timer = Timer.New(function ()
|
||||
--设置人物上下飘动2s重置一次
|
||||
if self.count % 2 == 0 then
|
||||
|
@ -158,10 +170,18 @@ function YuJianXingPanel:SetTime()
|
|||
if YuJianXingManager.curState == 1 then
|
||||
self.nextRoundTime.text = string.format("下一轮倒计时:%s",TimeToMS(roundEnd))
|
||||
if roundEnd <= 0 then
|
||||
--开始游戏
|
||||
YuJianXingManager.ReGetInfo(function ()
|
||||
self:StartAnimation()
|
||||
end)
|
||||
end
|
||||
elseif YuJianXingManager.curState == 2 then
|
||||
self.nextRoundTime.text = string.format("比赛进行中···")
|
||||
self.waitTime.text = string.format("倒计时:%s",TimeToMS(roundEnd))
|
||||
if roundEnd <= 0 then
|
||||
YuJianXingManager.ReGetInfo(function ()
|
||||
self:Refresh()
|
||||
end)
|
||||
end
|
||||
end
|
||||
--活动倒计时
|
||||
activityEnd = activityEnd - 1
|
||||
|
|
Loading…
Reference in New Issue