From a90fc67e28b85254ea990cf605cf0c8a36509df6 Mon Sep 17 00:00:00 2001 From: Soraphis Date: Sun, 5 Feb 2023 14:44:41 +0100 Subject: [PATCH] fix: SyncGameObjectToList adding object multiple times to list --- .../Runtime/MonoBehaviourHelpers/SyncGameObjectToList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/BaseAtoms/Runtime/MonoBehaviourHelpers/SyncGameObjectToList.cs b/Packages/BaseAtoms/Runtime/MonoBehaviourHelpers/SyncGameObjectToList.cs index 1c6bbbde..f2b22610 100644 --- a/Packages/BaseAtoms/Runtime/MonoBehaviourHelpers/SyncGameObjectToList.cs +++ b/Packages/BaseAtoms/Runtime/MonoBehaviourHelpers/SyncGameObjectToList.cs @@ -4,7 +4,7 @@ using UnityEngine.Assertions; namespace UnityAtoms.BaseAtoms { /// - /// 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. /// [AddComponentMenu("Unity Atoms/MonoBehaviour Helpers/Sync GameObject To List")] [EditorIcon("atom-icon-delicate")] @@ -13,7 +13,7 @@ namespace UnityAtoms.BaseAtoms [SerializeField] private GameObjectValueList _list = default; - void OnEnable() + void Start() { Assert.IsNotNull(_list); _list.Add(gameObject);