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 5 additions and 8 deletions
Showing only changes of commit 53560fcc6b - Show all commits

View File

@ -15,7 +15,6 @@ namespace AsteroidGame.Entities
[Header("UI")]
[SerializeField] protected string _uiFriendlyName;
#region Props
public string UiFriendlyName => _uiFriendlyName;
@ -33,14 +32,12 @@ namespace AsteroidGame.Entities
private void InitializeDamageable()
{
if (Damageable != null) return;
Damageable = gameObject.AddComponent<Damageable>();
Damageable ??= gameObject.AddComponent<Damageable>();
}
private void InitializeTargetable()
{
if (Targetable != null) return;
Targetable = gameObject.AddComponent<Targetable>();
Targetable ??= gameObject.AddComponent<Targetable>();
}
private void AssignDamageable()

View File

@ -32,8 +32,8 @@ namespace AsteroidGame.Entities
private void InitializePower()
{
_power = gameObject.AddComponent<PowerBase>();
_power.SetConfig(_powerConfig);
_power ??= gameObject.AddComponent<PowerBase>();
_power.Initialize(_powerConfig);
}
protected void OnDisable()