diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 2d77d2bfc9..bb3201121b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -36,6 +36,7 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId) self.elementImg = Util.GetGameObject(go, "Pro/Image"):GetComponent("Image") -- local roleId=role.roleData.roleId + self.roleId=roleId local live=HeroConfig[role.roleData.roleId].Live -- 判断是否有皮肤 if not role.roleData.skinId or role.roleData.skinId == 0 then @@ -393,8 +394,12 @@ function EnemyView:OnShowHintText(_ArtFontType) end -function EnemyView:OnSkillPlay() - self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, "attack", false) +function EnemyView:OnSkillPlay(type) + local name="attack" + if type and type==1 then + name="skill" + end + self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, name, false) end function EnemyView:OnSkillEnd() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 92b617b627..b9c64479f8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -44,8 +44,9 @@ function PlayerView:onCreate(go, role, position, root) self.hpPassSlider.fillAmount = self.hpCache self.yujiaSlider.fillAmount = 0 local roleId=role.roleData.roleId + self.roleId=role.roleData.roleId -- 身外化身引导立绘展示处理 - if roleId == 21061 then + if self.roleId == 21061 then self.skinId = 0 if NameManager.roleSex == ROLE_SEX.BOY then self.livePath = "live2d_npc_boy" @@ -427,7 +428,7 @@ function PlayerView:OnShowHintText(_ArtFontType) end -function PlayerView:OnSkillPlay() +function PlayerView:OnSkillPlay(type) if not self.GameObject then return end @@ -448,7 +449,11 @@ function PlayerView:OnSkillPlay() -- end -- local cardRenderMat = self.liveRender.material -- cardRenderMat:SetInt("_IsMask", 0) - self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, "attack", false) + local name="attack" + if type and type==1 then + name="skill" + end + self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, name, false) end function PlayerView:OnSkillEnd() @@ -469,11 +474,15 @@ function PlayerView:OnSkillEnd() self.lvHpObj:SetActive(true) end -function PlayerView:OnSkillCastingStart() +function PlayerView:OnSkillCastingStart(type) -- 提前进入下一阶段 self.RoleLiveGO2:SetActive(true) self.lvHpObj:SetActive(false) - self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0, "touch", false) + local name="touch" + -- if type and type~=0 then + -- name="skill" + -- end + self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0,name, false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index 377261690f..b85ef54a6a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -21,6 +21,7 @@ function SkillCaster:ctor(unit, actionTime, soundTime, soundName, castingEfectNo self.castingEfectNode = castingEfectNode -- cast特效资源 self.castingNameNode = castingNameNode -- cast名称资源 self.effectRoot = self.owner.RootPanel.skillEffectRoot + self.roleConfig=ConfigManager.GetConfigData(ConfigName.RoleConfig,unit.roleId) -- self.owner.role.Event:AddEvent(BattleEventName.SkillCast, self.OnSkillCast, self) end @@ -50,9 +51,14 @@ function SkillCaster:OnSkillCast(skill) if IsNull(self.owner.GameObject) then return end + local type=0 + if self.roleConfig.ReadyAction and self.roleConfig.ReadyAction>0 then + type=1 + self.actionTime=self.roleConfig.ReadyAction/1000 + end -- 调用上层接口 if self.owner.OnSkillPlay then - self.owner:OnSkillPlay() + self.owner:OnSkillPlay(type) end -- 播放 -- 这里相当于技能前摇,等待立绘播放到需要释放关键帧的时间时继续释放技能(人物前摇特效) @@ -135,9 +141,13 @@ function SkillCaster:PlaySkillCastingEffect(combat, skill, func) self.owner:OnSkillCastStart(skill) end -- 调用上层接口 + local type=0 + if self.roleConfig.ReadyAction and self.roleConfig.ReadyAction>0 then + type=1 + end local _ExtraTime if self.owner.OnSkillCastingStart then - _ExtraTime = self.owner:OnSkillCastingStart() + _ExtraTime = self.owner:OnSkillCastingStart(type) end _ExtraTime = _ExtraTime or 0