zhibo
parent
ffa4750d81
commit
727ce04435
|
|
@ -79,13 +79,13 @@ function this:BindEvent()
|
|||
this.TabCtrl:SetChangeTabCallBack(this.OnTabChange)
|
||||
this.TabCtrl:Init(this.tabbox, _TabData)
|
||||
|
||||
this._CurTabIndex = 3
|
||||
this._CurTabIndex = 4
|
||||
end
|
||||
|
||||
---等于窗口的OnShow
|
||||
function this:OnShow()
|
||||
if this.TabCtrl then
|
||||
this.TabCtrl:ChangeTab(this._CurTabIndex or 3)
|
||||
this.TabCtrl:ChangeTab(this._CurTabIndex or 4)
|
||||
end
|
||||
|
||||
-- 开始定时刷新数据
|
||||
|
|
|
|||
|
|
@ -142,7 +142,6 @@ function this:InitComponent(root, parent, battleSceneLogic, battleScene)
|
|||
this.battleScene = battleScene
|
||||
|
||||
this.buffTipList = {}
|
||||
|
||||
this.effectRoot = Util.GetGameObject(root, "effectRoot")
|
||||
this.hitEffect = Util.GetGameObject(this.effectRoot, "UI_Map_XunBaoEffect_hit")
|
||||
this.buffTip = Util.GetGameObject(root, "effectRoot/money")
|
||||
|
|
@ -482,10 +481,17 @@ function this:CreateEnemy()
|
|||
|
||||
if table.indexof(randomPos,i) then--该位置表示可生成单位
|
||||
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroid)
|
||||
this.SetRoleSingleWithData(roleLiveGoRight[i], heroConfig, i, 1)
|
||||
table.insert(turnArrayRight, {livego = roleLiveGoRight[i], skillId = heroConfig.OpenSkillRules[1][2], heroid = heroid, deadTimes = this:randDeadTimes()})
|
||||
this:SetAttackData(i, 1)
|
||||
roleLiveGoRight[i]:SetActive(true)
|
||||
local func = function(result)
|
||||
if result then
|
||||
table.insert(turnArrayRight, {livego = roleLiveGoRight[i], skillId = heroConfig.OpenSkillRules[1][2], heroid = heroid, deadTimes = this:randDeadTimes()})
|
||||
this:SetAttackData(i, 1)
|
||||
roleLiveGoRight[i]:SetActive(true)
|
||||
else
|
||||
rightLiveCount = rightLiveCount -1
|
||||
table.insert(turnArrayRight, {livego = nil, skillId = nil, heroid = nil})
|
||||
end
|
||||
end
|
||||
this.SetRoleSingleWithData(roleLiveGoRight[i], heroConfig, i, 1,func)
|
||||
else
|
||||
table.insert(turnArrayRight, {livego = nil, skillId = nil, heroid = nil})
|
||||
end
|
||||
|
|
@ -506,7 +512,7 @@ function this:RandEnemy()
|
|||
end
|
||||
|
||||
---创建一个角色 camp:阵营(0=左方 1=右方)
|
||||
function this.SetRoleSingleWithData(go, _heroconfigData, _pos, camp)
|
||||
function this.SetRoleSingleWithData(go, _heroconfigData, _pos, camp,func)
|
||||
local liveName = GetResourcePath(_heroconfigData.Live)
|
||||
local _scale = 1 --_heroconfigData.Scale
|
||||
local curPos = Vector3.zero --_heroconfigData.Position
|
||||
|
|
@ -514,10 +520,14 @@ function this.SetRoleSingleWithData(go, _heroconfigData, _pos, camp)
|
|||
if liveName == "N1_btn_tongyong_guanbi" then
|
||||
|
||||
end
|
||||
|
||||
local liveNode = poolManager:LoadSpine(liveName, go.transform, Vector3.one * _scale, Vector3.New(curPos[1], curPos[2], 0))
|
||||
|
||||
if not liveNode then
|
||||
LogError("liveNode = nil _heroconfigData.Id:" .. _heroconfigData.Id)
|
||||
if func then
|
||||
func(false)
|
||||
end
|
||||
return
|
||||
end
|
||||
liveNode:SetLayer(BattleSceneLayer)
|
||||
local spineComponent = liveNode:GetComponent(SpineComponentName)
|
||||
|
|
@ -538,6 +548,9 @@ function this.SetRoleSingleWithData(go, _heroconfigData, _pos, camp)
|
|||
|
||||
liveNames[_pos] = liveName
|
||||
liveNodes[_pos] = liveNode
|
||||
if func then
|
||||
func(true)
|
||||
end
|
||||
end
|
||||
|
||||
---设置攻击数据
|
||||
|
|
|
|||
Loading…
Reference in New Issue