修改代码
parent
937ec44bf5
commit
87dfec134c
|
@ -111,6 +111,9 @@ function PoolManager:PreLoadAsset(resName,num, assetType, func)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PoolManager:LoadAsset(resName, assetType)
|
function PoolManager:LoadAsset(resName, assetType)
|
||||||
|
if resName=="" or resName==nil then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
local tempTable = self.mPoolTable[resName]
|
local tempTable = self.mPoolTable[resName]
|
||||||
if tempTable == nil then
|
if tempTable == nil then
|
||||||
tempTable = {}
|
tempTable = {}
|
||||||
|
|
|
@ -154,17 +154,23 @@ function PlayerView:onCreate(go, role, position, root)
|
||||||
local combatId = BattleManager.GetCombatIdBySkin(self.role.skill[1],self.skinId)
|
local combatId = BattleManager.GetCombatIdBySkin(self.role.skill[1],self.skinId)
|
||||||
local combat = BattleManager.GetSkillCombat(combatId)
|
local combat = BattleManager.GetSkillCombat(combatId)
|
||||||
self.SkillAttackDisplaceoffset=combat.AttackDisplaceoffset
|
self.SkillAttackDisplaceoffset=combat.AttackDisplaceoffset
|
||||||
self.RoleSkillLiveGo=poolManager:LoadLive(combat.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
|
if combat.CloseRangeHit~=nil and combat.CloseRangeHit~="" then
|
||||||
self.RoleSkillLiveGoTran = self.RoleSkillLiveGo:GetComponent("RectTransform")
|
self.RoleSkillLiveGo=poolManager:LoadLive(combat.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
|
||||||
self.RoleSkillLiveGoTran:SetParent(self.RoleLiveGO.transform)
|
self.RoleSkillLiveGoTran = self.RoleSkillLiveGo:GetComponent("RectTransform")
|
||||||
self.RoleSkillLiveGoTran.anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
|
self.RoleSkillLiveGoTran:SetParent(self.RoleLiveGO.transform)
|
||||||
self.RoleSkillLiveGoTran.localScale = Vector3.one
|
self.RoleSkillLiveGoTran.anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
|
||||||
self.RoleSkillLiveGoTran.sizeDelta = Vector2.New(1000, 1000)
|
self.RoleSkillLiveGoTran.localScale = Vector3.one
|
||||||
self.RoleSkillLiveGoGraphic = self.RoleSkillLiveGo:GetComponent("SkeletonGraphic")
|
self.RoleSkillLiveGoTran.sizeDelta = Vector2.New(1000, 1000)
|
||||||
self.RoleSkillLiveGoGraphic.AnimationState:SetAnimation(0, "idle", true)
|
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 combatId2 = BattleManager.GetCombatIdBySkin(self.role.superSkill[1],self.skinId)
|
||||||
local combat2 = BattleManager.GetSkillCombat(combatId2)
|
local combat2 = BattleManager.GetSkillCombat(combatId2)
|
||||||
|
if combat2.CloseRangeHit~=nil and combat2.CloseRangeHit~="" then
|
||||||
self.superSkillAttackDisplaceoffset=combat2.AttackDisplaceoffset
|
self.superSkillAttackDisplaceoffset=combat2.AttackDisplaceoffset
|
||||||
self.RoleSkillLiveGo2=poolManager:LoadLive(combat2.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
|
self.RoleSkillLiveGo2=poolManager:LoadLive(combat2.CloseRangeHit, go.transform.parent, Vector3.one, Vector3.zero)
|
||||||
self.RoleSkillLiveGoTran2 = self.RoleSkillLiveGo2:GetComponent("RectTransform")
|
self.RoleSkillLiveGoTran2 = self.RoleSkillLiveGo2:GetComponent("RectTransform")
|
||||||
|
@ -178,6 +184,7 @@ function PlayerView:onCreate(go, role, position, root)
|
||||||
-- local t= self.RoleLiveGOGraphic.SkeletonData.animations
|
-- local t= self.RoleLiveGOGraphic.SkeletonData.animations
|
||||||
self.RoleSkillLiveGoGraphic2.AnimationState:SetAnimation(0, "idle", true)
|
self.RoleSkillLiveGoGraphic2.AnimationState:SetAnimation(0, "idle", true)
|
||||||
self.RoleSkillLiveGo2:SetActive(true)
|
self.RoleSkillLiveGo2:SetActive(true)
|
||||||
|
end
|
||||||
-- 卡牌立绘显示
|
-- 卡牌立绘显示
|
||||||
--self.liveRender = Util.GetGameObject(go, "Mask/icon"):GetComponent("RawImage")
|
--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)
|
--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
|
end
|
||||||
LogError("skill触发")
|
LogError("skill触发")
|
||||||
self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, humanname, false)
|
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)
|
self:PlaySpineAnim(self.RoleSkillLiveGoGraphic, 0, name, false)
|
||||||
|
|
||||||
else
|
elseif self.RoleSkillLiveGoGraphic2~=nil then
|
||||||
-- name="skill"
|
-- name="skill"
|
||||||
self:PlaySpineAnim(self.RoleSkillLiveGoGraphic2, 0, name, false)
|
self:PlaySpineAnim(self.RoleSkillLiveGoGraphic2, 0, name, false)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue