kill enemies

This commit is contained in:
Sveske Juice 2024-04-21 09:59:11 +02:00
parent 9cd094d158
commit c759a5eb75
5 changed files with 260 additions and 0 deletions

View File

@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 2627284670810454475} - component: {fileID: 2627284670810454475}
- component: {fileID: 3695515590031474163} - component: {fileID: 3695515590031474163}
- component: {fileID: 9127653115427650586} - component: {fileID: 9127653115427650586}
- component: {fileID: 4071403574699041274}
m_Layer: 0 m_Layer: 0
m_Name: Sphere m_Name: Sphere
m_TagString: Untagged m_TagString: Untagged
@ -86,6 +87,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &4071403574699041274
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1484513804757582226}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 4711208715938537054, guid: 18a302e9a279644c19653ac58e191809, type: 3}
--- !u!1 &4905475334432804188 --- !u!1 &4905475334432804188
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -97,6 +120,7 @@ GameObject:
- component: {fileID: 4318888908952639763} - component: {fileID: 4318888908952639763}
- component: {fileID: 6038133753003561376} - component: {fileID: 6038133753003561376}
- component: {fileID: 7713656331555127907} - component: {fileID: 7713656331555127907}
- component: {fileID: 5571691407147423427}
m_Layer: 0 m_Layer: 0
m_Name: Cube m_Name: Cube
m_TagString: Untagged m_TagString: Untagged
@ -169,6 +193,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &5571691407147423427
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4905475334432804188}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -5495902117074765545, guid: 18a302e9a279644c19653ac58e191809, type: 3}
--- !u!1001 &320849908925323048 --- !u!1001 &320849908925323048
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -187,6 +233,11 @@ PrefabInstance:
propertyPath: MoneyDropOnDeath propertyPath: MoneyDropOnDeath
value: 25 value: 25
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8375692935498326348, guid: eff762e00bcd52a438a5abf98a554a0b,
type: 3}
propertyPath: m_Convex
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8711060493889635308, guid: eff762e00bcd52a438a5abf98a554a0b, - target: {fileID: 8711060493889635308, guid: eff762e00bcd52a438a5abf98a554a0b,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x

View File

@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 4196044277737084291} - component: {fileID: 4196044277737084291}
- component: {fileID: 7564610506935021097} - component: {fileID: 7564610506935021097}
- component: {fileID: 3645469771944819949} - component: {fileID: 3645469771944819949}
- component: {fileID: 8941228822861493822}
m_Layer: 0 m_Layer: 0
m_Name: Cube.002 m_Name: Cube.002
m_TagString: Untagged m_TagString: Untagged
@ -84,6 +85,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &8941228822861493822
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3231083907916497553}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -1550514412580984892, guid: d98e454151a6ff242b2b65cdea2b147b, type: 3}
--- !u!1 &5245729724523394288 --- !u!1 &5245729724523394288
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -95,6 +118,7 @@ GameObject:
- component: {fileID: 6284276867580951690} - component: {fileID: 6284276867580951690}
- component: {fileID: 6243685724512154118} - component: {fileID: 6243685724512154118}
- component: {fileID: 7245593571651325249} - component: {fileID: 7245593571651325249}
- component: {fileID: 5738640148765172803}
m_Layer: 0 m_Layer: 0
m_Name: Sphere.001 m_Name: Sphere.001
m_TagString: Untagged m_TagString: Untagged
@ -170,6 +194,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &5738640148765172803
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5245729724523394288}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 70948873267775455, guid: d98e454151a6ff242b2b65cdea2b147b, type: 3}
--- !u!1 &6007150768222056047 --- !u!1 &6007150768222056047
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -181,6 +227,7 @@ GameObject:
- component: {fileID: 7814617659454412460} - component: {fileID: 7814617659454412460}
- component: {fileID: 3556598478310389610} - component: {fileID: 3556598478310389610}
- component: {fileID: 1742843013608051939} - component: {fileID: 1742843013608051939}
- component: {fileID: 2954520591985992038}
m_Layer: 0 m_Layer: 0
m_Name: Cube.003 m_Name: Cube.003
m_TagString: Untagged m_TagString: Untagged
@ -254,6 +301,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &2954520591985992038
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6007150768222056047}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -8678823145569952518, guid: d98e454151a6ff242b2b65cdea2b147b, type: 3}
--- !u!1 &8439137990335698816 --- !u!1 &8439137990335698816
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -265,6 +334,7 @@ GameObject:
- component: {fileID: 5829932881554470356} - component: {fileID: 5829932881554470356}
- component: {fileID: 6832063665726950265} - component: {fileID: 6832063665726950265}
- component: {fileID: 6256289494710273022} - component: {fileID: 6256289494710273022}
- component: {fileID: 7657304077272360240}
m_Layer: 0 m_Layer: 0
m_Name: Cube.001 m_Name: Cube.001
m_TagString: Untagged m_TagString: Untagged
@ -337,6 +407,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &7657304077272360240
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8439137990335698816}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 4493585093827132993, guid: d98e454151a6ff242b2b65cdea2b147b, type: 3}
--- !u!1001 &4585900668521982005 --- !u!1001 &4585900668521982005
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 2581943205175689103} - component: {fileID: 2581943205175689103}
- component: {fileID: 712066307697701920} - component: {fileID: 712066307697701920}
- component: {fileID: 4230355486181096376} - component: {fileID: 4230355486181096376}
- component: {fileID: 6331934173114872566}
m_Layer: 0 m_Layer: 0
m_Name: Sphere.003 m_Name: Sphere.003
m_TagString: Untagged m_TagString: Untagged
@ -86,6 +87,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &6331934173114872566
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2553432573220452155}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 3447038591770236762, guid: e60b24c47552f824b837bfe6ab682658, type: 3}
--- !u!1 &4634280698832045599 --- !u!1 &4634280698832045599
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -97,6 +120,7 @@ GameObject:
- component: {fileID: 5174690768294890204} - component: {fileID: 5174690768294890204}
- component: {fileID: 579297057861196090} - component: {fileID: 579297057861196090}
- component: {fileID: 2244513670021367640} - component: {fileID: 2244513670021367640}
- component: {fileID: 6393901270052841039}
m_Layer: 0 m_Layer: 0
m_Name: Cube.006 m_Name: Cube.006
m_TagString: Untagged m_TagString: Untagged
@ -169,6 +193,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &6393901270052841039
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4634280698832045599}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -2228417370725966487, guid: e60b24c47552f824b837bfe6ab682658, type: 3}
--- !u!1001 &4585900668521982005 --- !u!1001 &4585900668521982005
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 5502987293853872770} - component: {fileID: 5502987293853872770}
- component: {fileID: 5635140987920469086} - component: {fileID: 5635140987920469086}
- component: {fileID: 8365036987529120051} - component: {fileID: 8365036987529120051}
- component: {fileID: 3683587732828919725}
m_Layer: 0 m_Layer: 0
m_Name: Cube.004 m_Name: Cube.004
m_TagString: Untagged m_TagString: Untagged
@ -83,6 +84,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &3683587732828919725
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 328181127392286608}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -5053925668127403250, guid: f213d10596067dd42a05d8fbce2813a2, type: 3}
--- !u!1 &1198457551814079549 --- !u!1 &1198457551814079549
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -94,6 +117,7 @@ GameObject:
- component: {fileID: 7940863433879303452} - component: {fileID: 7940863433879303452}
- component: {fileID: 7226785372496171369} - component: {fileID: 7226785372496171369}
- component: {fileID: 2393395469905274384} - component: {fileID: 2393395469905274384}
- component: {fileID: 2490027983335431706}
m_Layer: 0 m_Layer: 0
m_Name: Cube.005 m_Name: Cube.005
m_TagString: Untagged m_TagString: Untagged
@ -166,6 +190,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &2490027983335431706
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1198457551814079549}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 2212009239438826721, guid: f213d10596067dd42a05d8fbce2813a2, type: 3}
--- !u!1 &8635889218845086774 --- !u!1 &8635889218845086774
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -177,6 +223,7 @@ GameObject:
- component: {fileID: 4732930958137629346} - component: {fileID: 4732930958137629346}
- component: {fileID: 7776676039101429320} - component: {fileID: 7776676039101429320}
- component: {fileID: 2272425703536899450} - component: {fileID: 2272425703536899450}
- component: {fileID: 6159188677169204229}
m_Layer: 0 m_Layer: 0
m_Name: Sphere.002 m_Name: Sphere.002
m_TagString: Untagged m_TagString: Untagged
@ -252,6 +299,28 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &6159188677169204229
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8635889218845086774}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 212370497460711607, guid: f213d10596067dd42a05d8fbce2813a2, type: 3}
--- !u!1001 &4585900668521982005 --- !u!1001 &4585900668521982005
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -48,6 +48,8 @@ public class Projectile : MonoBehaviour
private void OnCollisionEnter(Collision collision) private void OnCollisionEnter(Collision collision)
{ {
HealthComponent hitHealthComp = collision.gameObject.GetComponent<HealthComponent>(); HealthComponent hitHealthComp = collision.gameObject.GetComponent<HealthComponent>();
if (hitHealthComp == null)
hitHealthComp = collision.transform.root.GetComponentInChildren<HealthComponent>();
// if (hitHealthComp == comingFrom) return; // if (hitHealthComp == comingFrom) return;
if (hitHealthComp) if (hitHealthComp)
{ {