Beat Saber modding library that standardizes the use of GameObject layers and provides tools for easier rendering pipeline modifications
Check out CameraUtilsSandbox project for more code/usage examples
class HmdOnlyExample: MonoBehaviour {
private void Awake() {
gameObject.SetLayer(VisibilityLayer.HmdOnlyAndReflected);
//If you don't want object to be rendered in reflections, use VisibilityLayer.HmdOnly
}
}class DesktopOnlyExample: MonoBehaviour {
private void Awake() {
gameObject.SetLayer(VisibilityLayer.DesktopOnlyAndReflected);
//If you don't want object to be rendered in reflections, use VisibilityLayer.DesktopOnly
}
}- To add your camera to the system, simply call
CamerasManager.RegisterDesktopCamera(Camera yourCamera) - Make sure to remove your camera on destroy, using
CamerasManager.UnRegisterCamera(Camera yourCamera) - Alternatively, you can just add
AutoCameraRegistratorcomponent to the Camera's GameObject
private void InitCamera(Camera camera) {
camera.gameObject.AddComponent<AutoCameraRegistrator>();
}- To insert custom logic into the render pipeline, use
CamerasManager.RegisterCameraEffect() - Make sure to remove your effects on dispose, using
CamerasManager.UnRegisterCameraEffect()