GameDev.CoreSystems/Architecture/ScriptableObjects/Examples/Scripts/ObjectAdder.cs

19 lines
447 B
C#

using UnityEngine;
namespace ScriptableObjectArchitecture.Examples
{
public class ObjectAdder : MonoBehaviour
{
[SerializeField]
private GameObjectCollection _targetCollection = default(GameObjectCollection);
private void OnEnable()
{
_targetCollection.Add(gameObject);
}
private void OnDisable()
{
_targetCollection.Remove(gameObject);
}
}
}