From 814d455eabe3a367d73430e1c17ae82ee346e943 Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sun, 21 Apr 2024 12:24:41 +0200 Subject: [PATCH] fix --- Assets/Prefabs/Enemies/Enemy.prefab | 2 +- Assets/Scripts/Utilities/HealthComponent.cs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/Enemies/Enemy.prefab b/Assets/Prefabs/Enemies/Enemy.prefab index 6d12b34..604a179 100644 --- a/Assets/Prefabs/Enemies/Enemy.prefab +++ b/Assets/Prefabs/Enemies/Enemy.prefab @@ -52,7 +52,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 369596802107988542} m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp - m_MethodName: SimpleKill + m_MethodName: EnemyKill m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} diff --git a/Assets/Scripts/Utilities/HealthComponent.cs b/Assets/Scripts/Utilities/HealthComponent.cs index e0413f8..16b2422 100644 --- a/Assets/Scripts/Utilities/HealthComponent.cs +++ b/Assets/Scripts/Utilities/HealthComponent.cs @@ -34,16 +34,15 @@ public class HealthComponent : MonoBehaviour OnHealthZero?.Invoke(); } + public void EnemyKill() + { + Destroy(gameObject); + } + public void SimpleKill() { CameraShake.instance.ShakeCamera(0.5f, 0.2f); - var cam = CinemachineCore.Instance.GetActiveBrain(0).ActiveVirtualCamera.Priority -= 1; - - CinemachineCore.Instance.GetActiveBrain(0).ActiveVirtualCamera.VirtualCameraGameObject.GetComponent().m_Offset.z = TowerCam.instance.originalOffset; - - HideWall.instance.target = null; - Destroy(gameObject); } }