Esempio n. 1
0
 private void SetOff(bool callEvents)
 {
     if (m_isOn)
     {
         m_isOn = false;
         RemoveSensor();
         ClearDetectedEntities(callEvents);
         NeedsUpdate = false;
         if (m_isSlowDetector)
         {
             MyEntityDetectorsManager.UnregisterSlowDetectorForUpdate(this);
         }
     }
 }
Esempio n. 2
0
 public void On()
 {
     //Debug.Assert(!m_isOn);
     if (!m_isOn)
     {
         m_isOn = true;
         AddSensor();
         NeedsUpdate = true;
         if (m_isSlowDetector)
         {
             MyEntityDetectorsManager.RegisterSlowDetectorForUpdate(this);
         }
     }
 }
Esempio n. 3
0
        public override void UpdateBeforeSimulation()
        {
            if (m_isClosed)
            {
                Debug.Fail("This shoudln't happen!");
                return;
            }
            //base.UpdateBeforeSimulation();

            if (m_isOn)
            {
                if (m_isSlowDetector && !MyEntityDetectorsManager.CanBeSlowDetectorUpdated(this))
                {
                    return;
                }
                if (m_containsCriteriumToReCheck)
                {
                    UpdateObservableEntities();
                }
                UpdateDetectedEntities();
            }
        }