void RemoveFromContainer() { if (m_currentContainer) { m_currentContainer.onFlexUpdate -= OnFlexUpdate; m_currentContainer.onBeforeRecreate -= OnBeforeRecreate; m_currentContainer.onAfterRecreate -= OnAfterRecreate; m_currentContainer.onBeforeDestroy -= OnBeforeDestroy; m_currentContainer.RemoveActor(this); m_currentContainer = null; } }
void AddToContainer() { if (m_container) { m_currentContainer = m_container; m_currentContainer.onFlexUpdate += OnFlexUpdate; m_currentContainer.onBeforeRecreate += OnBeforeRecreate; m_currentContainer.onAfterRecreate += OnAfterRecreate; m_currentContainer.onBeforeDestroy += OnBeforeDestroy; m_currentContainer.AddActor(this); } }