void Container_ComponentAdded(Type compType, MyEntityComponentBase component) { if (compType == typeof(MyUseObjectsComponentBase)) { m_useObjectComp = component as MyUseObjectsComponentBase; } }
void Container_ComponentRemoved(Type compType, MyEntityComponentBase component) { if (compType == typeof(MyUseObjectsComponentBase)) { m_useObjectComp = null; } }
public override void OnBeforeRemovedFromContainer() { m_useObjectComp = null; if (Container.Entity.InScene) { Debug.Assert(m_respawns.Contains(this), "Double remove of respawn component from the respawns list"); m_respawns.Remove(this); } base.OnBeforeRemovedFromContainer(); }