mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
fix: SyncGameObjectToList adding object multiple times to list (#389)
This commit is contained in:
parent
fb471754bc
commit
f75215adba
@ -4,7 +4,7 @@ using UnityEngine.Assertions;
|
|||||||
namespace UnityAtoms.BaseAtoms
|
namespace UnityAtoms.BaseAtoms
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a GameObject to a GameObject Value List on OnEnable and removes it on OnDestroy.
|
/// Adds a GameObject to a GameObject Value List on Start and removes it on OnDestroy.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AddComponentMenu("Unity Atoms/MonoBehaviour Helpers/Sync GameObject To List")]
|
[AddComponentMenu("Unity Atoms/MonoBehaviour Helpers/Sync GameObject To List")]
|
||||||
[EditorIcon("atom-icon-delicate")]
|
[EditorIcon("atom-icon-delicate")]
|
||||||
@ -13,7 +13,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private GameObjectValueList _list = default;
|
private GameObjectValueList _list = default;
|
||||||
|
|
||||||
void OnEnable()
|
void Start()
|
||||||
{
|
{
|
||||||
Assert.IsNotNull(_list);
|
Assert.IsNotNull(_list);
|
||||||
_list.Add(gameObject);
|
_list.Add(gameObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user