public void AquireTarget() { for (int i = 0; i < 25; i++) { MyDetectedEntityInfo detected = default(MyDetectedEntityInfo); if (i == 0) { detected = mainCam.Raycast(detectionRange); } else { float pitch = random.Next(1, 50) / 10f; float yaw = random.Next(1, 50) / 10f; detected = mainCam.Raycast(detectionRange, pitch, yaw); } if (detected.HitPosition.HasValue) { detection = new LongRangeDetection(detected.HitPosition.Value, cameras, this); Echo($"Target aquired @ {detected.HitPosition.ToString()}"); if (projector != null) { projector.Enable(); } break; } DisposeAuto(); } }
public void DisposeDetection() { detection = null; if (projector != null) { projector.Disable(); } if (leadProjector != null) { leadProjector.Disable(); } }
void NewLongRangeDetection(Vector3D position) { longRangeDetection = new LongRangeDetection(position, cameras, rc.GetPosition()); longRangeDetection.OnTargetFound += OnTargetDetected; }