Modified existing RuntimeSets to be compatible with SOArchitecture
This commit is contained in:
parent
a4cab80edb
commit
c82e4960a8
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 5d4aeffddee253346bece1700851153d
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 1e81b384c7f010b4fa3c1b8f293a4c42
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue