private void SetOff(bool callEvents) { if (m_isOn) { m_isOn = false; RemoveSensor(); ClearDetectedEntities(callEvents); NeedsUpdate = false; if (m_isSlowDetector) { MyEntityDetectorsManager.UnregisterSlowDetectorForUpdate(this); } } }
public void On() { //Debug.Assert(!m_isOn); if (!m_isOn) { m_isOn = true; AddSensor(); NeedsUpdate = true; if (m_isSlowDetector) { MyEntityDetectorsManager.RegisterSlowDetectorForUpdate(this); } } }
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(); } }