From ae8021cd6a368bbd7799ef0bff66c24fc6145963 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 25 Nov 2021 15:04:55 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97=E8=A1=A8=E7=8E=B0]=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=E6=95=8C=E6=88=91=E6=96=B9=E7=AB=8B=E7=BB=98?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/View/Unit/EnemyView.lua | 12 +++++++++++- .../Modules/Battle/View/Unit/PlayerView.lua | 18 ++++++++++++------ .../Modules/Battle/View/Unit/SkillCaster.lua | 6 +++++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 3242b71337..f2fc31e77a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -99,7 +99,17 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId) self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2] + 400) self.RoleLiveGO2.transform.localScale = Vector3.one * self.enemy_liveScale --* 2 self.RoleLiveGO2:SetActive(false) - + local toward=HeroConfig[role.roleData.roleId].Toward + if toward==2 then + local mirrOffset=RoleConfig[roleId].mirrorimage_offset + if mirrOffset and mirrOffset[1]~=0 and mirrOffset[2]~=0 then + self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + end + + self.RoleLiveGO:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + self.RoleLiveGO2:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + end -- 阴影 self.shadow = Util.GetGameObject(self.RootPanel.EnemyPanel, "live_"..position.."/shadow") self.shadow:SetActive(true) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 92b663699c..907a946ab4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -105,8 +105,7 @@ function PlayerView:onCreate(go, role, position, root) self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5 self.RoleLiveGO.transform.localScale = Vector3.one * self.enemy_liveScale self.RoleLiveGO:SetActive(true) - - + -- 卡牌立绘显示 --self.liveRender = Util.GetGameObject(go, "Mask/icon"):GetComponent("RawImage") --self.liveRender.texture, self.aaa , _, self.RoleLiveParnet = CardRendererManager.GetSpineTexture(role.position, self.livePath, Vector3.one * self.play_liveScale, Vector3.New(self.offset[1], self.offset[2], 0), false) --self.spLoader:LoadSprite(heroData.painting) @@ -117,9 +116,6 @@ function PlayerView:onCreate(go, role, position, root) -- self.liveRender.transform.anchoredPosition = Vector3.zero--Vector2.New(self.offset[1], self.offset[2]) -- self.liveRender.gameObject:SetActive(true) -- self.liveRender.material:SetInt("_IsMask", 1) - - - -- casting技能立绘 self.RoleLiveGO2 = poolManager:LoadLive(self.livePath, go.transform.parent, Vector3.one, Vector3.zero) self.RoleLiveGO2.transform:SetParent(self.RootPanel.mySkillCastRoot.transform) @@ -130,7 +126,17 @@ function PlayerView:onCreate(go, role, position, root) self.RoleLiveGOTran2 = self.RoleLiveGO2:GetComponent("RectTransform") self.RoleLiveGOGraphic2.AnimationState:SetAnimation(0, "idle", true) self.RoleLiveGOTran2.sizeDelta = Vector2.New(1000, 1000) - + local toward=HeroConfig[role.roleData.roleId].Toward + if toward==1 then + local mirrOffset=RoleConfig[roleId].mirrorimage_offset + if mirrOffset and mirrOffset[1]~=0 and mirrOffset[2]~=0 then + self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + end + self.RoleLiveGO:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + self.RoleLiveGO2:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + end + -- self.RoleIconGO = Util.GetGameObject(go, "func") self.RoleIconGO:SetActive(true) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index 349548914e..12cbbdf033 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -40,7 +40,7 @@ function SkillCaster:OnSkillCast(skill) BattleManager.PauseBattle() -- 调用上层接口 if self.owner.OnSkillCastStart then - self.owner:OnSkillCastStart() + self.owner:OnSkillCastStart(skill) end self.owner.RootPanel.SetRoleHighLight(self.owner, skill:GetDirectTargets(), function() @@ -118,6 +118,10 @@ function SkillCaster:PlaySkillCastingEffect(combat, skill, func) if self.owner.role.type == BattleUnitType.Monster then self:CheckSkillForoleEffect(combat, skill) end + + if self.owner.OnSkillCastStart then + self.owner:OnSkillCastStart(skill) + end -- 调用上层接口 if self.owner.OnSkillCastingStart then self.owner:OnSkillCastingStart()