* Get the first camera effect matching the given class. * @param effectClass - the effect class to search for * @returns the first matching effect, or undefined * @example * const shake = camera.getCameraEffect(ShakeEffect);
( effectClass: new (...args: any[]) => T, )
| 799 | * const shake = camera.getCameraEffect(ShakeEffect); |
| 800 | */ |
| 801 | getCameraEffect<T extends CameraEffect>( |
| 802 | effectClass: new (...args: any[]) => T, |
| 803 | ): T | undefined { |
| 804 | return this.cameraEffects.find((fx) => fx instanceof effectClass) as |
| 805 | | T |
| 806 | | undefined; |
| 807 | } |
| 808 | |
| 809 | /** |
| 810 | * Remove a specific camera effect instance. |
no outgoing calls
no test coverage detected