Merge branch 'china/dev' into china/test

dev_chengFeng
zhangshanxue 2021-11-23 15:27:31 +08:00
commit 96a4af1532
4 changed files with 12 additions and 8 deletions

View File

@ -754,6 +754,7 @@ function this.GetFakeBattleData(fakeId)
battleData.enemyData[1].firstCamp = 1 battleData.enemyData[1].firstCamp = 1
battleData.playerData.firstCamp = 0 battleData.playerData.firstCamp = 0
end end
battleData.enemyId=fakeId
return battleData, fakeConfig.TimeSeed return battleData, fakeConfig.TimeSeed
end end

View File

@ -666,7 +666,7 @@ function this.OnAddRole(data)
if this.isBoss and data.position == 2 then if this.isBoss and data.position == 2 then
isBoss = true isBoss = true
end end
tbRole[data] = EnemyView.New(go, data, data.position, this, isBoss) tbRole[data] = EnemyView.New(go, data, data.position, this, isBoss,this.fightData.enemyId)
end end
go.transform.localScale = Vector3.one go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero go.transform.localPosition = Vector3.zero

View File

@ -6,11 +6,11 @@ function BattleUnit.New(go, role, position, root, isBoss)
return o return o
end end
function BattleUnit:ctor(go, role, position, root, isBoss) function BattleUnit:ctor(go, role, position, root, isBoss,enemyId)
self._DelayFuncList = {} self._DelayFuncList = {}
self._LoopFuncList = {} self._LoopFuncList = {}
if self.onCreate then if self.onCreate then
self:onCreate(go, role, position, root, isBoss) self:onCreate(go, role, position, root, isBoss,enemyId)
end end
end end

View File

@ -8,23 +8,23 @@ local reliveEffect1 = "fx_chongsheng_lianhua"
local reliveEffect2 = "fx_chongsheng_lizhi" local reliveEffect2 = "fx_chongsheng_lizhi"
EnemyView = BattleUnit.New() EnemyView = BattleUnit.New()
function EnemyView.New(go, role, position, root, isBoss) function EnemyView.New(go, role, position, root, isBoss,enemysId)
local o = BattleUnit.New(go, role, position, root) local o = BattleUnit.New(go, role, position, root)
setmetatable(o, EnemyView) setmetatable(o, EnemyView)
EnemyView.__index = EnemyView EnemyView.__index = EnemyView
o:ctor(go, role, position, root, isBoss) o:ctor(go, role, position, root, isBoss,enemysId)
return o return o
end end
function EnemyView:onCreate(go, role, position, root, isBoss) function EnemyView:onCreate(go, role, position, root, isBoss,enemyId)
self.spLoader = SpriteLoader.New() self.spLoader = SpriteLoader.New()
self.RootPanel = root self.RootPanel = root
self.GameObject = go self.GameObject = go
self.role = role self.role = role
self.camp = role.camp self.camp = role.camp
self.isBoss = isBoss self.isBoss = isBoss
self.enemysId=enemyId --剧情id用于处理剧情特殊显示
-- 创建技能播放器 -- 创建技能播放器
self.castingEfectNode = self.RootPanel.enemySkillCast self.castingEfectNode = self.RootPanel.enemySkillCast
self.castingNameNode = Util.GetGameObject(self.castingEfectNode, "TongYong_Casting_Shang/DongHua/MingZi") self.castingNameNode = Util.GetGameObject(self.castingEfectNode, "TongYong_Casting_Shang/DongHua/MingZi")
@ -69,7 +69,10 @@ function EnemyView:onCreate(go, role, position, root, isBoss)
self.nameText.text = SubString2(self.readingName,9) self.nameText.text = SubString2(self.readingName,9)
self.level.text = role:GetRoleData(RoleDataName.Level) self.level.text = role:GetRoleData(RoleDataName.Level)
self.elementImg.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(role.roleData.element)) self.elementImg.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(role.roleData.element))
if self.enemysId and self.enemysId==1017 then
Util.GetGameObject(go, "Name"):GetComponent("RectTransform").anchoredPosition=Vector3.New(20,-180,0)
Util.GetGameObject(go, "Pro"):GetComponent("RectTransform").anchoredPosition=Vector3.New(-77,-180,0)
end
-- --
self.RoleLiveGO = poolManager:LoadLive(self.livePath, go.transform.parent, Vector3.one, Vector3.zero) self.RoleLiveGO = poolManager:LoadLive(self.livePath, go.transform.parent, Vector3.one, Vector3.zero)
self.RoleLiveGOGraphic = self.RoleLiveGO:GetComponent("SkeletonGraphic") self.RoleLiveGOGraphic = self.RoleLiveGO:GetComponent("SkeletonGraphic")