コード例 #1
0
 void Container_ComponentAdded(Type compType, MyEntityComponentBase component)
 {
     if (compType == typeof(MyUseObjectsComponentBase))
     {
         m_useObjectComp = component as MyUseObjectsComponentBase;
     }
 }
コード例 #2
0
 void Container_ComponentRemoved(Type compType, MyEntityComponentBase component)
 {
     if (compType == typeof(MyUseObjectsComponentBase))
     {
         m_useObjectComp = null;
     }
 }
コード例 #3
0
        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();
        }