From 707908f7c2eb8d3d04a09396ee5186f867f95c8c Mon Sep 17 00:00:00 2001 From: wangzhenxing <1545929779@qq.com> Date: Wed, 21 Aug 2024 19:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=8C=E6=96=B9=E8=8B=B1=E9=9B=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/View/Unit/EnemyView.lua | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 4410517a6a..2d0aad98cb 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -137,13 +137,13 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId) self.RoleSkillLiveGoTran2.localPosition = Vector2.New(0, 0)-- * 0.5 end - self.RoleSkillLiveGoTran2.localScale = combat2.CloseRangeHitScale==nil and Vector3.one or Vector3.New( combat2.CloseRangeHitScale[1]/1000, combat2.CloseRangeHitScale[2]/1000,1) + self.RoleSkillLiveGoTran2.localScale = self.combat2.CloseRangeHitScale==nil and Vector3.New(10,10,1) or Vector3.New( self.combat2.CloseRangeHitScale[1]/1000, self.combat2.CloseRangeHitScale[2]/1000,1) self.RoleSkillLiveGoTran2.sizeDelta = Vector2.New(1000, 1000) self.RoleSkillLiveGoGraphic2 = self.RoleSkillLiveGo2:GetComponent("SkeletonGraphic") self.RoleSkillLiveGoGraphic2.AnimationState.TimeScale=combat2.SkillTimeScale/1000 -- local t= self.RoleLiveGOGraphic.SkeletonData.animations - self.RoleSkillLiveGoGraphic2.AnimationState:SetAnimation(0, "idle", true) - self.RoleSkillLiveGo2:SetActive(true) + self.RoleSkillLiveGoGraphic2.AnimationState:SetAnimation(0, "play_skill_self", true) + self.RoleSkillLiveGo2:SetActive(false) end -- casting技能立绘 self.RoleLiveGO2 = poolManager:LoadLive(self.livePath2, go.transform.parent, Vector3.one, Vector3.zero) @@ -469,7 +469,12 @@ function EnemyView:PlaySpineAnim(gog, time, name, isLoop) local _complete = nil _complete = function(state) gog.AnimationState.Complete = gog.AnimationState.Complete - _complete - gog.AnimationState:SetAnimation(0, "idle", true) + if endWith(gog.gameObject.name,"skill") then + gog.gameObject:SetActive(false) + else + gog.AnimationState:SetAnimation(0, "idle", true) + end + self.currAniName="idle" end gog.AnimationState:ClearTracks() -- 清除上一个动画的影响(修复概率攻击动画播放错误的问题) @@ -496,9 +501,9 @@ function EnemyView:OnSkillPlay(type) -- end local name="attack" - local humanname="attack" + local humanname="atk" if type and type==2 then - humanname="skill" + humanname="skill2" end self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, humanname, false) @@ -507,7 +512,8 @@ function EnemyView:OnSkillPlay(type) elseif self.RoleSkillLiveGoGraphic~=nil then -- name="skill" - self:PlaySpineAnim(self.RoleSkillLiveGoGraphic2, 0, name, false) + self.RoleSkillLiveGo2:SetActive(true) + self:PlaySpineAnim(self.RoleSkillLiveGoGraphic2, 0, "play_skill_self", false) end end @@ -830,6 +836,7 @@ function EnemyView:OnDead() self.hpPassSlider.fillAmount = 0 --死亡后不把怒气条显示清空,处理触发不灭怒气不足四点 怒气条清空 2021/09/01 --self.rageSlider.fillAmount = 0 + --self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, "die", false) self.rageText.text = "" end