You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
AtomList and AtomCollection don't have an option to clear on enable like the ValueList types.
Describe the solution you'd like
AtomList and AtomCollection should follow the same pattern as ValueLists and include a clear on enable option,
or AtomList and AtomCollection should follow the same pattern as atoms generally and be split into Variable and Constant variants.
Describe alternatives you've considered
Using an on start monohook to manually clear the Lists and Collections. This is unneeded overhead when other atom objects are able to initialize themselves as needed,
Create a copy of AtomList that is clearable outside of the atoms package. This is much more achievable for these types than other atoms, since they don't need to be recreated for each new atom type, but it is still duplication and makes upgrading and maintaining code harder.
Additional context
A simple implementation borrowed from BaseAtomValueList
/// <summary>
/// Whether the list should start cleared
/// </summary>
[SerializeField]
protected bool _startCleared;
void OnEnable()
{
if (Value == null) return;
Value.Added += PropogateAdded;
Value.Removed += PropogateRemoved;
Value.Cleared += PropogateCleared;
if (_startCleared)
{
_value.Clear();
}
}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
AtomList and AtomCollection don't have an option to clear on enable like the ValueList types.
Describe the solution you'd like
AtomList and AtomCollection should follow the same pattern as ValueLists and include a clear on enable option,
or AtomList and AtomCollection should follow the same pattern as atoms generally and be split into Variable and Constant variants.
Describe alternatives you've considered
Using an on start monohook to manually clear the Lists and Collections. This is unneeded overhead when other atom objects are able to initialize themselves as needed,
Create a copy of AtomList that is clearable outside of the atoms package. This is much more achievable for these types than other atoms, since they don't need to be recreated for each new atom type, but it is still duplication and makes upgrading and maintaining code harder.
Additional context
A simple implementation borrowed from
BaseAtomValueList
The text was updated successfully, but these errors were encountered: