using System.Collections;
using UnityEngine;
namespace UnityAtoms
{
///
/// None generic base class of Lists. Inherits from `BaseAtom`.
///
[EditorIcon("atom-icon-piglet")]
public abstract class BaseAtomValueList : BaseAtom
{
///
/// Event for when the list is cleared.
///
public AtomEventBase Cleared;
protected abstract IList IList { get; }
///
/// Whether the list should start cleared
///
[SerializeField]
protected bool _startCleared;
///
/// Clear the list.
///
public void Clear()
{
IList.Clear();
if (null != Cleared)
{
Cleared.Raise();
}
}
protected virtual void OnEnable()
{
if (_startCleared)
{
Clear();
}
}
}
}