Modified existing RuntimeSets to be compatible with SOArchitecture

This commit is contained in:
Stedd 2023-10-28 16:33:02 +02:00
parent a4cab80edb
commit c82e4960a8
9 changed files with 9 additions and 46 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5d4aeffddee253346bece1700851153d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
namespace GameDev.CoreSystems
{
public abstract class SoRuntimeSet<T> : ScriptableObject
{
public List<T> _list;
public void Add(T component)
{
_list.Add(component);
}
public void Remove(T component)
{
_list.Remove(component);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 1e81b384c7f010b4fa3c1b8f293a4c42
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,10 +1,11 @@
using ScriptableObjectArchitecture;
using UnityEngine; using UnityEngine;
namespace GameDev.CoreSystems namespace GameDev.CoreSystems
{ {
[CreateAssetMenu(fileName = "newDamageableRuntimeSet", menuName = "RuntimeSet/Damageable")] [CreateAssetMenu(fileName = "newDamageableRuntimeSet", menuName = "RuntimeSet/Damageable")]
public class SoDamageableRuntimeSet : SoRuntimeSet<Damageable> public class SoDamageableRuntimeSet : Collection<Damageable>
{ {
//asdf
} }
} }

View File

@ -1,9 +1,10 @@
using ScriptableObjectArchitecture;
using UnityEngine; using UnityEngine;
namespace GameDev.CoreSystems namespace GameDev.CoreSystems
{ {
[CreateAssetMenu(fileName = "newTargetableRuntimeSet", menuName = "RuntimeSet/Targetable")] [CreateAssetMenu(fileName = "newTargetableRuntimeSet", menuName = "RuntimeSet/Targetable")]
public class SoTargetableRuntimeSet : SoRuntimeSet<Targetable> public class SoTargetableRuntimeSet : Collection<Targetable>
{ {
} }
} }

View File

@ -16,12 +16,12 @@ namespace GameDev.CoreSystems
private void OnEnable() private void OnEnable()
{ {
_activeDamageableRuntimeSet._list.Add(this); _activeDamageableRuntimeSet.Add(this);
} }
private void OnDisable() private void OnDisable()
{ {
_activeDamageableRuntimeSet._list.Remove(this); _activeDamageableRuntimeSet.Remove(this);
} }
#region Methods #region Methods

View File

@ -19,12 +19,12 @@ namespace GameDev.CoreSystems
private void OnEnable() private void OnEnable()
{ {
_activeTargetableRuntimeSet._list.Add(this); _activeTargetableRuntimeSet.Add(this);
} }
private void OnDisable() private void OnDisable()
{ {
_activeTargetableRuntimeSet._list.Remove(this); _activeTargetableRuntimeSet.Remove(this);
} }
public Vector3 GetCenterPosition() => _centerPosition.transform.position; public Vector3 GetCenterPosition() => _centerPosition.transform.position;