Skip to content

Commit

Permalink
fredrik spurte, anders er snurt
Browse files Browse the repository at this point in the history
  • Loading branch information
SondreHus committed Oct 20, 2021
1 parent 153b23b commit d198c77
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 18 deletions.
96 changes: 80 additions & 16 deletions Assets/Prefabs/Base/Base.prefab
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &252185320
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 252185321}
- component: {fileID: 252185324}
- component: {fileID: 252185323}
- component: {fileID: 252185322}
m_Layer: 9
m_Name: HitBox
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &252185321
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 252185320}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 5.05, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5829545455071137389}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &252185324
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 252185320}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 1.5
m_Height: 3.7580233
m_Direction: 1
m_Center: {x: 0, y: -5.122213, z: 0}
--- !u!54 &252185323
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 252185320}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &252185322
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 252185320}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dde39a3ed8a181143bd4f0d992b95909, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 10
maxHealth: 100
--- !u!1 &416639623
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -57,7 +134,6 @@ GameObject:
- component: {fileID: 5829545455071137387}
- component: {fileID: 5829545455071137386}
- component: {fileID: 5829545455071137385}
- component: {fileID: 990519977}
- component: {fileID: 990519971}
m_Layer: 8
m_Name: Base
Expand All @@ -80,6 +156,7 @@ Transform:
- {fileID: 5829545456270998754}
- {fileID: 416639624}
- {fileID: 8695880071544847346}
- {fileID: 252185321}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -160,22 +237,9 @@ MonoBehaviour:
gameOverScreen: {fileID: 6406541465688870762, guid: cf6616ecfd76d4b379c4e4fd196293af, type: 3}
explosion: {fileID: 8540785681650497039, guid: 2c5fbfe28e3b404499f4e21b605c375f, type: 3}
spawnPoint: {fileID: 5829545455071137389}
healthController: {fileID: 252185322}
crystals: 0
drainRay: {fileID: 2977432110045038679, guid: 1fa3e9df0696ada43b1fbfe045184210, type: 3}
--- !u!114 &990519977
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5829545455071137399}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dde39a3ed8a181143bd4f0d992b95909, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 10
maxHealth: 100
--- !u!95 &990519971
Animator:
serializedVersion: 3
Expand Down Expand Up @@ -238,7 +302,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7c544ac82addbb54b804f4935ba759fc, type: 3}
propertyPath: m_LocalPosition.y
value: 0
value: -0.43
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7c544ac82addbb54b804f4935ba759fc, type: 3}
propertyPath: m_LocalPosition.z
Expand Down
7 changes: 5 additions & 2 deletions Assets/Scripts/GameState/BaseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class BaseController : MonoBehaviour
[SerializeField]
private Transform spawnPoint;

[SerializeField]
private HealthLogic healthController;

// Death flag
private bool dead = false;

Expand Down Expand Up @@ -48,12 +51,12 @@ void Awake()

#endregion Singleton boilerplate

GetComponent<HealthLogic>().onDeath += Die;
healthController.onDeath += Die;
}

void OnDestroy()
{
GetComponent<HealthLogic>().onDeath -= Die;
healthController.onDeath -= Die;
}

void OnTriggerEnter(Collider other)
Expand Down

0 comments on commit d198c77

Please sign in to comment.