小兵战斗添加血条

tcx_xiyou_solider
PC-202302260912\Administrator 2024-03-22 17:38:21 +08:00
parent b73f51af89
commit 008056935c
4 changed files with 164 additions and 4 deletions

View File

@ -78403,7 +78403,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 184, y: 749}
m_AnchoredPosition: {x: 184, y: 759.4}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7998446057042298325
@ -79843,6 +79843,81 @@ MonoBehaviour:
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &3991402921035320164
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4594492938401723161}
- component: {fileID: 681905489447249999}
- component: {fileID: 3195857153133471948}
m_Layer: 5
m_Name: hpBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4594492938401723161
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3991402921035320164}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 345522315851906538}
m_Father: {fileID: 6461990839478086415}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -58.54499, y: 724}
m_SizeDelta: {x: 445.09, y: 22.2}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &681905489447249999
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3991402921035320164}
m_CullTransparentMesh: 0
--- !u!114 &3195857153133471948
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3991402921035320164}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 1da7ad396d9a31e4bad01ddac05c21a6, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &4021192248023384996
GameObject:
m_ObjectHideFlags: 0
@ -100958,6 +101033,80 @@ MonoBehaviour:
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: New Text
--- !u!1 &4632242360712477108
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 345522315851906538}
- component: {fileID: 4191965412185588157}
- component: {fileID: 4633480784460064311}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &345522315851906538
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4632242360712477108}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4594492938401723161}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4191965412185588157
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4632242360712477108}
m_CullTransparentMesh: 0
--- !u!114 &4633480784460064311
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4632242360712477108}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: a107a73ff774dc94ea4ccaaeb6a6f90e, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 0
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &4656702335948235859
GameObject:
m_ObjectHideFlags: 0
@ -145990,6 +146139,7 @@ RectTransform:
- {fileID: 1950929182907263283}
- {fileID: 6471780584234647524}
- {fileID: 3273070043154839095}
- {fileID: 4594492938401723161}
m_Father: {fileID: 3223588515252977199}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -1261,8 +1261,8 @@ function this.RecycleAllDelayRes()
--立即回收延迟列表上的资源
for _, v in pairs(this._delayRecycleList) do
for i=1, #v do
Util.SetGray(v[i].go, false)
if v[i].go then
Util.SetGray(v[i].go, false)
poolManager:UnLoadAsset(v[i].path, v[i].go, PoolManager.AssetType.GameObject)
end
end

View File

@ -299,7 +299,7 @@ function FloatNode:ArtFloatingOnHook(type, color, value,frameColor)
if go then
poolManager:UnLoadAsset(floatingEffect,go, PoolManager.AssetType.GameObject)
end
end,1,1.5):Start()
end,1,1):Start()
end
return FloatNode

View File

@ -276,6 +276,7 @@ function FightPointPassMainPanel:InitComponent()
this.bossObj=Util.GetGameObject(self.gameObject, "battlePanel/bossObj")
this.bossImg=Util.GetGameObject(self.gameObject, "battlePanel/bossObj/icon"):GetComponent("Image")
this.bossNum=Util.GetGameObject(self.gameObject, "battlePanel/bossObj/num"):GetComponent("Text")
this.hpBar=Util.GetGameObject(self.gameObject, "battlePanel/hpBar/Image"):GetComponent("Image")
end
--绑定事件(用于子类重写)
@ -566,11 +567,17 @@ function this.BattleLogic()
local curTime=GetTimeStamp()
local cha=math.floor(curTime - bossInfo.leaveTime)
battleTime=battleTime- cha
bossHp=bossHp-math.floor(cha/timeStamp)*bossInfo.attack
if battleTime>0 then
bossHp=bossHp-math.floor(cha/timeStamp)*bossInfo.attack
else
battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp
end
else
battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp
end
this.hpBar.fillAmount=bossHp/curSoliderStageConfig.Hp
this.timeTxt.text=battleTime
this.hpTxt.text=bossHp
LogError("curSoliderStageConfig.Time===="..curSoliderStageConfig.Time.." curSoliderStageConfig.Hp=="..curSoliderStageConfig.Hp)
@ -632,6 +639,7 @@ function this.BattleLogic()
--end
end
curAttack=allAttacck
this.hpBar.fillAmount=bossHp/curSoliderStageConfig.Hp
cd=0
end
bossSpine.AnimationState:SetAnimation(0, "idle", true)
@ -645,6 +653,7 @@ function this.BattleLogic()
cd=0
battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp
this.hpBar.fillAmount=bossHp/curSoliderStageConfig.Hp
this.battleTimer:Start()
end
if bossHp<=0 then
@ -676,6 +685,7 @@ function this.BattleLogic()
cd=0
battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp
this.hpBar.fillAmount=bossHp/curSoliderStageConfig.Hp
this.RefreshBossInfo()
end)
end