private void Die() { IsAlive = false; rb.velocity = Vector2.zero; rb.angularVelocity = 0; rb.isKinematic = true; rb.bodyType = RigidbodyType2D.Kinematic; enabled = false; playerAnimatorController.Fight(); OnCaptured?.Invoke(); }
/// <summary> /// コマンドバッファの処理を待つ /// </summary> private IEnumerator WaitCapture() { yield return(new WaitForEndOfFrame()); BlendGUI(); if (OnCaptured != null) { OnCaptured.Invoke(_buf); } RemoveCommandBuffer(); }
public void CapturePhotoAsync(OnCaptured _callback) { callback = _callback; PhotoCapture.CreateAsync(false, (_photoCapture) => { Debug.Log("PhotoInput start"); this.photoCapture = _photoCapture; Resolution cameraResolution = PhotoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First(); CameraParameters c = new CameraParameters(); c.hologramOpacity = 0.0f; c.cameraResolutionWidth = cameraResolution.width; c.cameraResolutionHeight = cameraResolution.height; c.pixelFormat = CapturePixelFormat.BGRA32; c.hologramOpacity = 0; this.cameraParameters = c; photoCapture.StartPhotoModeAsync(cameraParameters, onPhotoModeStarted); }); }
private void ProcessFrame(object sender, EventArgs e) { _vidCapture.Retrieve(_m); if (_intrisicsLoaded) { // CvInvoke.Undistort(_m, _undist, _cameraMatrix, _distCoeffs); // CvInvoke.CvtColor(_undist, _gray, ColorConversion.Bgr2Gray); CvInvoke.CvtColor(_m, _gray, ColorConversion.Bgr2Gray); } else { CvInvoke.CvtColor(_m, _gray, ColorConversion.Bgr2Gray); } CvInvoke.Threshold(_gray, _bin, _threshold, 255, ThresholdType.Binary); _blobDetector.FindBlobs(_drawBlobs, _intrisicsLoaded); _graphics.DrawImage(_bin.Bitmap, 0, 0, 640, 480); if (_calibration != null) { _graphics.DrawImage(_calibration.GetCalibImage(_deviceNum), 0, 0, 640, 480); } OnCaptured?.Invoke(new BitmapEventArgs(_niBin, (int)_fps, _deviceNum)); if (sw != null) { Fps = 1000 / sw.ElapsedMilliseconds; } sw = Stopwatch.StartNew(); }