修改代码

onepiece_demo_arena
xiejun 2023-07-13 17:04:48 +08:00
parent 937ec44bf5
commit 87dfec134c
2 changed files with 20 additions and 10 deletions

View File

@ -111,6 +111,9 @@ function PoolManager:PreLoadAsset(resName,num, assetType, func)
end
function PoolManager:LoadAsset(resName, assetType)
if resName=="" or resName==nil then
return nil
end
local tempTable = self.mPoolTable[resName]
if tempTable == nil then
tempTable = {}

View File

@ -154,17 +154,23 @@ function PlayerView:onCreate(go, role, position, root)
local combatId = BattleManager.GetCombatIdBySkin(self.role.skill[1],self.skinId)
local combat = BattleManager.GetSkillCombat(combatId)
self.SkillAttackDisplaceoffset=combat.AttackDisplaceoffset
self.RoleSkillLiveGo=poolManager:LoadLive(combat.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
self.RoleSkillLiveGoTran = self.RoleSkillLiveGo:GetComponent("RectTransform")
self.RoleSkillLiveGoTran:SetParent(self.RoleLiveGO.transform)
self.RoleSkillLiveGoTran.anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
self.RoleSkillLiveGoTran.localScale = Vector3.one
self.RoleSkillLiveGoTran.sizeDelta = Vector2.New(1000, 1000)
self.RoleSkillLiveGoGraphic = self.RoleSkillLiveGo:GetComponent("SkeletonGraphic")
self.RoleSkillLiveGoGraphic.AnimationState:SetAnimation(0, "idle", true)
if combat.CloseRangeHit~=nil and combat.CloseRangeHit~="" then
self.RoleSkillLiveGo=poolManager:LoadLive(combat.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
self.RoleSkillLiveGoTran = self.RoleSkillLiveGo:GetComponent("RectTransform")
self.RoleSkillLiveGoTran:SetParent(self.RoleLiveGO.transform)
self.RoleSkillLiveGoTran.anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
self.RoleSkillLiveGoTran.localScale = Vector3.one
self.RoleSkillLiveGoTran.sizeDelta = Vector2.New(1000, 1000)
self.RoleSkillLiveGoGraphic = self.RoleSkillLiveGo:GetComponent("SkeletonGraphic")
self.RoleSkillLiveGoGraphic.AnimationState:SetAnimation(0, "idle", true)
end
local combatId2 = BattleManager.GetCombatIdBySkin(self.role.superSkill[1],self.skinId)
local combat2 = BattleManager.GetSkillCombat(combatId2)
if combat2.CloseRangeHit~=nil and combat2.CloseRangeHit~="" then
self.superSkillAttackDisplaceoffset=combat2.AttackDisplaceoffset
self.RoleSkillLiveGo2=poolManager:LoadLive(combat2.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
self.RoleSkillLiveGoTran2 = self.RoleSkillLiveGo2:GetComponent("RectTransform")
@ -178,6 +184,7 @@ function PlayerView:onCreate(go, role, position, root)
-- local t= self.RoleLiveGOGraphic.SkeletonData.animations
self.RoleSkillLiveGoGraphic2.AnimationState:SetAnimation(0, "idle", true)
self.RoleSkillLiveGo2:SetActive(true)
end
-- 卡牌立绘显示
--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)
@ -560,10 +567,10 @@ function PlayerView:OnSkillPlay(type)
end
LogError("skill触发")
self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, humanname, false)
if type==0 then
if type==0 and self.RoleSkillLiveGoGraphic ~= nil then
self:PlaySpineAnim(self.RoleSkillLiveGoGraphic, 0, name, false)
else
elseif self.RoleSkillLiveGoGraphic2~=nil then
-- name="skill"
self:PlaySpineAnim(self.RoleSkillLiveGoGraphic2, 0, name, false)
end