This commit is contained in:
OliverS 2024-02-04 02:20:09 +01:00
commit 8277314729
32 changed files with 558 additions and 303 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &6232425507328955236 --- !u!1 &6833538753401515138
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -8,10 +8,10 @@ GameObject:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 81829978540419969} - component: {fileID: 4735696322134991437}
- component: {fileID: 3789424986669542967} - component: {fileID: 2776254023051504893}
- component: {fileID: 3270777934385952829} - component: {fileID: 2851877176569532699}
- component: {fileID: 3979768280741324332} - component: {fileID: 4288064990526774250}
m_Layer: 0 m_Layer: 0
m_Name: DamageText m_Name: DamageText
m_TagString: Untagged m_TagString: Untagged
@ -19,32 +19,32 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!224 &81829978540419969 --- !u!224 &4735696322134991437
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6232425507328955236} m_GameObject: {fileID: 6833538753401515138}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 3288169701052299107}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -0.72} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 3, y: 2} m_SizeDelta: {x: 3, y: 2}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &3789424986669542967 --- !u!23 &2776254023051504893
MeshRenderer: MeshRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6232425507328955236} m_GameObject: {fileID: 6833538753401515138}
m_Enabled: 1 m_Enabled: 1
m_CastShadows: 0 m_CastShadows: 0
m_ReceiveShadows: 0 m_ReceiveShadows: 0
@ -80,13 +80,13 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &3270777934385952829 --- !u!114 &2851877176569532699
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6232425507328955236} m_GameObject: {fileID: 6833538753401515138}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
@ -109,8 +109,8 @@ MonoBehaviour:
m_fontMaterials: [] m_fontMaterials: []
m_fontColor32: m_fontColor32:
serializedVersion: 2 serializedVersion: 2
rgba: 4279085303 rgba: 4294967295
m_fontColor: {r: 0.9685534, g: 0.6569338, b: 0.051777944, a: 1} m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0 m_enableVertexGradient: 0
m_colorMode: 3 m_colorMode: 3
m_fontColorGradient: m_fontColorGradient:
@ -127,8 +127,8 @@ MonoBehaviour:
m_faceColor: m_faceColor:
serializedVersion: 2 serializedVersion: 2
rgba: 4294967295 rgba: 4294967295
m_fontSize: 5 m_fontSize: 8
m_fontSizeBase: 5 m_fontSizeBase: 8
m_fontWeight: 400 m_fontWeight: 400
m_enableAutoSizing: 0 m_enableAutoSizing: 0
m_fontSizeMin: 18 m_fontSizeMin: 18
@ -170,15 +170,15 @@ MonoBehaviour:
_SortingLayerID: 0 _SortingLayerID: 0
_SortingOrder: 0 _SortingOrder: 0
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_renderer: {fileID: 3789424986669542967} m_renderer: {fileID: 2776254023051504893}
m_maskType: 0 m_maskType: 0
--- !u!111 &3979768280741324332 --- !u!111 &4288064990526774250
Animation: Animation:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6232425507328955236} m_GameObject: {fileID: 6833538753401515138}
m_Enabled: 1 m_Enabled: 1
serializedVersion: 3 serializedVersion: 3
m_Animation: {fileID: 7400000, guid: a6deca1a46fd10e4c966a1a58f998693, type: 2} m_Animation: {fileID: 7400000, guid: a6deca1a46fd10e4c966a1a58f998693, type: 2}
@ -188,3 +188,78 @@ Animation:
m_PlayAutomatically: 1 m_PlayAutomatically: 1
m_AnimatePhysics: 0 m_AnimatePhysics: 0
m_CullingType: 0 m_CullingType: 0
--- !u!1 &8357464303304312906
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3288169701052299107}
- component: {fileID: 2241243433806884705}
m_Layer: 0
m_Name: DamageText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3288169701052299107
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8357464303304312906}
serializedVersion: 2
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4735696322134991437}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2241243433806884705
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8357464303304312906}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 01c9b525ae607a844848c8e44062a0f1, type: 3}
m_Name:
m_EditorClassIdentifier:
damageToSize:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 1
value: 1
inSlope: 0.011841985
outSlope: 0.011841985
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 1
- serializedVersion: 3
time: 250
value: 2
inSlope: 0.004031593
outSlope: 0.004031593
tangentMode: 0
weightedMode: 0
inWeight: 0.9989648
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
damageText: {fileID: 2851877176569532699}
normalColor: {r: 0.90943396, g: 0.90943396, b: 0.90943396, a: 1}
critColor: {r: 1, g: 0.63425434, b: 0.2245282, a: 1}
superCritColor: {r: 1, g: 0.103773475, b: 0.103773475, a: 1}
critThreshold: 25
superCritThreshold: 65

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9ac131fe76b864945a3aeb678a16f786 guid: 25c9a2db8fc5b7c4f8feebba5c73e7a3
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -255,21 +255,10 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
maxHealth: 100 maxHealth: 100
damageTickDelay: 1
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -288,6 +277,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
maxHealth: 100 maxHealth: 100
damageTickDelay: 0.25
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -172,19 +172,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: -4060921817738925561}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -256,19 +256,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 1169561095041589923}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -173,19 +173,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -173,19 +173,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -173,19 +173,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100 maxHealth: 100
OnHealthZero: OnHealthZero:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls: []
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []

View File

@ -78,6 +78,6 @@ Material:
- _UVSec: 0 - _UVSec: 0
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _Color: {r: 0.8301887, g: 0.15299344, b: 0.13705944, a: 0.4627451} - _Color: {r: 0.8301887, g: 0.15299338, b: 0.13705936, a: 0.7372549}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

View File

@ -11,7 +11,23 @@ public class EnemyAnimationHandler : MonoBehaviour
if (animator != animator.enabled) if (animator != animator.enabled)
animator.enabled = true; animator.enabled = true;
GetComponent<HealthComponent>().OnHealthZero.AddListener(EnemyDie);
} }
void EnemyDie()
{
StartCoroutine(AnimationDie());
}
IEnumerator AnimationDie()
{
Strangle();
yield return new WaitForSecondsRealtime(1f);
Die();
while (animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1f)
yield return new WaitForEndOfFrame();
Destroy(gameObject);
}
public void Strangle() public void Strangle()
{ {
animator.SetTrigger("Die"); animator.SetTrigger("Die");
@ -19,5 +35,6 @@ public class EnemyAnimationHandler : MonoBehaviour
public void Die() public void Die()
{ {
animator.SetTrigger("Die"); animator.SetTrigger("Die");
} }
} }

View File

@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyAfter : MonoBehaviour
{
[SerializeField]
private float destroyInSeconds = 1.0f;
public void Init(float delay)
{
this.destroyInSeconds = delay;
Destroy(gameObject, delay);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 612e58b28f1e9ab449b1bba4737e2dc2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -22,9 +22,9 @@ public class HealthBar : MonoBehaviour
attachedHealth.OnHealthChange.RemoveListener(UpdateHealthBar); attachedHealth.OnHealthChange.RemoveListener(UpdateHealthBar);
} }
private void UpdateHealthBar(int prevHealth, int newHealth) private void UpdateHealthBar(float prevHealth, float newHealth)
{ {
float percent = ((float) newHealth) / ((float)attachedHealth.getMaxHealth()); float percent = newHealth / attachedHealth.getMaxHealth();
healthBarImg.fillAmount = percent; healthBarImg.fillAmount = percent;
} }
} }

View File

@ -1,14 +1,23 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Events; using UnityEngine.Events;
using TMPro; using TMPro;
using System;
using UnityUtils;
public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
{ {
[SerializeField] int maxHealth = 100; [SerializeField] float maxHealth = 100;
public int currentHealth { get; private set; }
[SerializeField] float damageTickDelay = 0.25f;
private float currentDamageTick = 0f;
private float accumulatedDamageInTick = 0f;
public float currentHealth { get; private set; }
public static event Action<Vector3, float> OnHealthChangeAtPos;
public UnityEvent OnHealthZero; public UnityEvent OnHealthZero;
public UnityEvent<int, int> OnHealthChange; public UnityEvent<float, float> OnHealthChange;
[Header("Squeze Damage")] [Header("Squeze Damage")]
[SerializeField] [SerializeField]
@ -22,25 +31,43 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
currentHealth = maxHealth; currentHealth = maxHealth;
} }
public int getMaxHealth() { void Update()
{
if (currentDamageTick < Time.time)
{
if (accumulatedDamageInTick < 1f) return;
OnHealthChangeAtPos?.Invoke(transform.position.Add(y: 2f), accumulatedDamageInTick);
currentDamageTick = Time.time + damageTickDelay;
accumulatedDamageInTick = 0f;
}
}
public float getMaxHealth() {
return maxHealth; return maxHealth;
} }
public void setMaxHealth(int amount, bool heal = false) { public void setMaxHealth(float amount, bool heal = false) {
maxHealth = amount; maxHealth = amount;
if (heal) if (heal)
currentHealth = amount; currentHealth = amount;
} }
public void TakeDamage(int damage) public void TakeDamage(float damage)
{ {
currentHealth -= damage; currentHealth -= damage;
OnHealthChange?.Invoke(currentHealth + damage, currentHealth); OnHealthChange?.Invoke(currentHealth + damage, currentHealth);
accumulatedDamageInTick += damage;
if (currentHealth <= 0) { if (currentHealth <= 0) {
// Make sure to flush accumulated when dying
if (accumulatedDamageInTick > 1f)
OnHealthChangeAtPos?.Invoke(transform.position.Add(y: 2f), accumulatedDamageInTick);
OnHealthZero?.Invoke(); OnHealthZero?.Invoke();
BloodComputeShader.Instance.createBlood(transform.position, (int)(maxHealth *maxHealth * BloodComputeShader.Instance.scoreMult), maxHealth / 25.0f); BloodComputeShader.Instance.createBlood(transform.position, (int)(maxHealth *maxHealth * BloodComputeShader.Instance.scoreMult), maxHealth / 8.0f);
} }
} }
@ -51,8 +78,9 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
TakeDamage((int) Mathf.Round(squezeDamage * squezeDamageScalor)); TakeDamage((int) Mathf.Round(squezeDamage * squezeDamageScalor));
} }
public void SimpleKill() public void EnemyKill()
{ {
Destroy(gameObject); Destroy(gameObject);
} }
} }

View File

@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class DamageText : MonoBehaviour
{
[SerializeField] AnimationCurve damageToSize;
[SerializeField] TextMeshPro damageText;
[SerializeField]
private Color normalColor, critColor, superCritColor;
[SerializeField]
private float critThreshold, superCritThreshold;
public void Init(float damage)
{
transform.localScale = Vector3.one * damageToSize.Evaluate(damage);
damageText.color = normalColor;
if (damage > critThreshold)
damageText.color = critColor;
if (damage > superCritThreshold)
damageText.color = superCritColor;
damageText.text = damage.ToString();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 01c9b525ae607a844848c8e44062a0f1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using JetBrains.Annotations;
using UnityEngine;
public class DamageTextManager : MonoBehaviour
{
[SerializeField] Transform textParent;
[SerializeField] GameObject damageTextPrefab;
[SerializeField] float lifeTime = 3f;
private void OnEnable()
{
HealthComponent.OnHealthChangeAtPos += SpawnDamage;
}
private void OnDisable()
{
HealthComponent.OnHealthChangeAtPos -= SpawnDamage;
}
public void SpawnDamage(Vector3 position, float damage)
{
GameObject go = Instantiate(damageTextPrefab, position, Quaternion.identity, textParent);
go.GetComponent<DamageText>().Init(damage);
go.AddComponent<DestroyAfter>().Init(lifeTime);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aab27275f26e5e244856836f6d17b909
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -24,7 +24,7 @@ public class HealthDisplay : MonoBehaviour
healthComponent.OnHealthChange.RemoveListener(UpdateHealth); healthComponent.OnHealthChange.RemoveListener(UpdateHealth);
} }
public void UpdateHealth(int prevHealth, int newHealth) public void UpdateHealth(float prevHealth, float newHealth)
{ {
healthText.text = padding + healthComponent.currentHealth; healthText.text = padding + healthComponent.currentHealth;
} }