【新手战斗】选择女角色后,战斗中立绘替换为女角色
parent
3a70720f9c
commit
b6ea250096
|
@ -705,6 +705,17 @@ function this.OnAddMonster(data)
|
|||
|
||||
end
|
||||
end
|
||||
|
||||
-- 遍历灵兽列表
|
||||
function this.ForeachMonster(func)
|
||||
for _, monster in pairs(tbMonster) do
|
||||
if func then
|
||||
func(monster)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 移除灵兽
|
||||
function this.OnRemoveMonster(data)
|
||||
local view = tbMonster[data]
|
||||
if view then
|
||||
|
|
|
@ -65,10 +65,12 @@ end
|
|||
|
||||
--添加事件监听(用于子类重写)
|
||||
function this:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, this.OnNameChange)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function this:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, this.OnNameChange)
|
||||
end
|
||||
|
||||
function this:OnSortingOrderChange()
|
||||
|
@ -200,6 +202,29 @@ function this.OnUpdate()
|
|||
|
||||
end
|
||||
|
||||
-- 当改变姓名的时候
|
||||
function this.OnNameChange()
|
||||
if this.guideType == 3 and NameManager.roleSex ~= ROLE_SEX.BOY then
|
||||
BattleView.ForeachMonster(function(monster)
|
||||
if monster.role.position == 100 and monster.camp == 0 then
|
||||
-- 删除原来的
|
||||
GameObject.DestroyImmediate(monster.RoleLiveGO2)
|
||||
-- casting技能立绘 替换成女角色
|
||||
monster.livePath="live2d_npc_girl"
|
||||
monster.RoleLiveGO2 = poolManager:LoadLive(monster.livePath, monster.skillCastRoot.gameObject.transform.parent, Vector3.one, Vector3.zero)
|
||||
monster.RoleLiveGO2.transform:SetParent(monster.skillCastRoot.gameObject.transform)
|
||||
monster.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(monster.offset[1], monster.offset[2])
|
||||
monster.RoleLiveGO2.transform.localScale = Vector3.one * monster.play_liveScale
|
||||
monster.RoleLiveGO2:SetActive(false)
|
||||
monster.RoleLiveGOGraphic2 = monster.RoleLiveGO2:GetComponent("SkeletonGraphic")
|
||||
monster.RoleLiveGOTran2 = monster.RoleLiveGO2:GetComponent("RectTransform")
|
||||
monster.RoleLiveGOGraphic2.AnimationState:SetAnimation(0, "idle", true)
|
||||
monster.RoleLiveGOTran2.sizeDelta = Vector2.New(1000, 1000)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function this:OnClose()
|
||||
BattleView:OnClose()
|
||||
|
|
Loading…
Reference in New Issue