Components OnDisable
and OnDestroy
logic doesn't match OnAwake
, OnEnable
, and OnStart
#295
Labels
OnDisable
and OnDestroy
logic doesn't match OnAwake
, OnEnable
, and OnStart
#295
Description
Currently,
OnAwake
,OnEnable
, andOnStart
are called by theActor
when a component is created during gameplay (m_playing
is true), or when starting the scene, butOnDisable
andOnDestroy
are called by the component when the component gets destroyed (even if the game isn't playing).Expected behavior
OnDisable
andOnDestroy
should only be called when a component gets removed during gameplay, or on actor destruction (i.e. gameplay stops/scene change...)Also, only
Actor
should call theOnSomething()
methods, so we should move this code out of theAComponent::dtor()
:Additional Note
Having
OnDisable
andOnDestroy
being called even when the game is not playing can result into some weird unexpected behaviorsThe text was updated successfully, but these errors were encountered: