From e7abac49ce34db799b356514c11a938233cba1fe Mon Sep 17 00:00:00 2001 From: wangzhenxing <1545929779@qq.com> Date: Sun, 31 Dec 2023 15:56:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=E6=8A=A5=E7=A9=BA=E5=88=A4=E6=96=AD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/View/Unit/MonsterView.lua | 6 +-- .../Modules/Battle/View/Unit/SkillCaster.lua | 37 +++++++++++-------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua index 1354ca26ac..264a99c4ae 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua @@ -36,7 +36,7 @@ function MonsterView:onCreate(go, role, position, root) end if role.roleData.id == 20100 then if role.sex == ROLE_SEX.BOY then - self.livePath = "live2d_caomaolufei" + self.livePath = "live2d_caomaolufeizhanshi" else self.livePath = "live2d_namei" end @@ -75,7 +75,7 @@ function MonsterView:onCreate(go, role, position, root) self.RoleLiveGOTran = self.RoleLiveGO:GetComponent("RectTransform") self.RoleLiveGOGraphic.AnimationState:SetAnimation(0, "idle", true) self.RoleLiveGOTran.sizeDelta = Vector2.New(1000, 1000) --- + self.startPos=self.RoleLiveGO.transform.position -- local combatId = BattleManager.GetCombatIdBySkin(self.role.skill[1],self.skinId) -- self.combat = BattleManager.GetSkillCombat(combatId) -- self.SkillAttackDisplaceoffset=self.combat.AttackDisplaceoffset @@ -278,7 +278,7 @@ function MonsterView:OnSkillCastingStart(skill) --self.RoleLiveGO2.gameObject:SetActive(false) if self.isMainPlayer then - self.RoleLiveGO3.gameObject:SetActive(false) + self.RoleLiveGO3.gameObject:SetActive(true) else self.RoleLiveGO3.gameObject:SetActive(true) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index f9e0ef62da..87a2bd219d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -882,24 +882,29 @@ function SkillCaster:CheckSkillHitEffect(checkType, combat, skill) local scale = combat.HitScale and Vector3.New(combat.HitScale[1]/1000, combat.HitScale[2]/1000, 0) or Vector3.One local sortingOrder = self.owner.role.camp == 0 and self.owner.GameObject:GetComponent("Canvas").sortingOrder + 21 or BattleManager.GetBattleSorting() + 20 local go2 = BattleManager.LoadSpineAsset(combat.Hit, self.owner.SingleHitEffectRoot.transform) + if go2 then + -- 检测特效旋转 go2.transform:SetParent(self.owner.SingleHitEffectRoot.transform) - -- 检测特效旋转 - local compnet=go2:GetComponent("SkeletonGraphic") - if compnet~=nil then - -- compnet.transform.localScale = Vector3.one * 3 - -- compnet.transform.sizeDelta = Vector2.New(1000, 1000) - compnet.AnimationState:SetAnimation(0, "attack", true) - compnet.AnimationState.TimeScale=combat.HitTimeScale/1000 + local compnet=go2:GetComponent("SkeletonGraphic") + if compnet~=nil then + -- compnet.transform.localScale = Vector3.one * 3 + -- compnet.transform.sizeDelta = Vector2.New(1000, 1000) + compnet.AnimationState:SetAnimation(0, "attack", true) + compnet.AnimationState.TimeScale=combat.HitTimeScale/1000 + end + if self:CheckRotate(go2, combat.HitOrientation) then + offset = -offset + end + go2.transform.localPosition = Vector3.zero--self.GameObject.transform.localPosition + Vector3.New(0, self.BuffFloatingCount * 180, 0) + go2.transform.anchoredPosition = offset--Vector2.zero + -- go2.transform:SetParent(self.effectRoot.transform) + go2.transform.localScale = scale + go2:SetActive(true) + BattleManager.AddDelayRecycleRes(combat.Hit, go2,combat.HitRecycleTime/1000 ) + else + LogError("combat.hit=========="..combat.Hit.." is null") end - if self:CheckRotate(go2, combat.HitOrientation) then - offset = -offset - end - go2.transform.localPosition = Vector3.zero--self.GameObject.transform.localPosition + Vector3.New(0, self.BuffFloatingCount * 180, 0) - go2.transform.anchoredPosition = offset--Vector2.zero - -- go2.transform:SetParent(self.effectRoot.transform) - go2.transform.localScale = scale - go2:SetActive(true) - BattleManager.AddDelayRecycleRes(combat.Hit, go2,combat.HitRecycleTime/1000 ) + LogError("HitTime") end