Using .AddTo() in a MonoBehaviour adds an ObservableDestroyTrigger to the specified game object. If a component has the [ExecuteInEditMode] attribute then the destroy trigger is added to the game object when it is being edited on a prefab. As this component holds data only used in the current "session", and not needed to be saved, shouldn't it receive something like hideFlags |= HideFlags.DontSaveInEditor; in the constructor or at Awake? Having an additional ObservableDestroyTrigger in the prefab is probably not harmful, but it's kind of a noise, as if the other subscribing components are removed then it is not even needed on the prefab.
Using
.AddTo()
in a MonoBehaviour adds anObservableDestroyTrigger
to the specified game object. If a component has the[ExecuteInEditMode]
attribute then the destroy trigger is added to the game object when it is being edited on a prefab. As this component holds data only used in the current "session", and not needed to be saved, shouldn't it receive something likehideFlags |= HideFlags.DontSaveInEditor;
in the constructor or at Awake? Having an additional ObservableDestroyTrigger in the prefab is probably not harmful, but it's kind of a noise, as if the other subscribing components are removed then it is not even needed on the prefab.