Dev/ScriptableObjectsRefactor #4

Merged
Stedd merged 17 commits from Dev/ScriptableObjectsRefactor into master 2024-10-05 17:34:01 +02:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit bb89431807 - Show all commits

@ -1 +1 @@
Subproject commit 4005878930047e686a5efbd876ebee4cb3d97442
Subproject commit c81a750f2fd89f8ba79c098c353f100e0925637f

View File

@ -1,4 +1,3 @@
using AsteroidGame.ScriptableObjects;
using GameDev.CoreSystems;
using UnityEngine;
@ -33,6 +32,12 @@ namespace AsteroidGame.Entities
private void InitializeDamageable()
{
Damageable ??= gameObject.AddComponent<Damageable>();
Damageable.DeathEvent.AddListener(HandleDeath);
}
private void HandleDeath()
{
Destroy(gameObject);
}
private void InitializeTargetable()