예제 #1
0
 /**
  * Adds the specified detector to the list of observed detectors.
  * 
  * The same detector cannot be added more than once.
  * @param Detector the detector to watch.
  * @since 4.1.2
  */
 public void AddDetector(Detector detector){
   if(!Detectors.Contains(detector)){
     Detectors.Add(detector);
     activateDetector(detector);
   }
 }
예제 #2
0
 /**
  * Removes the specified detector from the list of observed detectors;
  * 
  * @param Detector the detector to remove.
  * @since 4.1.2
  */
 public void RemoveDetector(Detector detector){
   detector.OnActivate.RemoveListener(CheckDetectors);
   detector.OnDeactivate.RemoveListener(CheckDetectors);
   Detectors.Remove(detector);
 }
예제 #3
0
 private void activateDetector(Detector detector){
   detector.OnActivate.RemoveListener(CheckDetectors); //avoid double subscription
   detector.OnDeactivate.RemoveListener(CheckDetectors);
   detector.OnActivate.AddListener(CheckDetectors);
   detector.OnDeactivate.AddListener(CheckDetectors);
 }