Class TextModeCRTCameraEffects
The registration point for camera CRT implementations. A render pipeline package registers one; the rest of the game asks for it here.
Inherited Members
Namespace: Scylla.TextMode.CRT
Assembly: ScyllaTextMode.CRT.dll
Syntax
public static class TextModeCRTCameraEffects
Remarks
At most one implementation is registered at a time, the one of the active render pipeline. The registration is static and can change when the pipeline changes, so check Provider for null and ask CanShow(Camera, out string) before relying on it.
The following example shows the main camera through the CRT with a switched-on tube, and switches the effect off again.
var provider = TextModeCRTCameraEffects.Provider;
var camera = Camera.main;
if (provider != null && provider.CanShow(camera, out var reason))
{
var settings = new TextModeCRTSettings();
var tube = new TextModeCRTTube();
provider.Show(camera, settings, CRTQualityTier.Medium, true, 0, tube);
/* Later. */
provider.Hide(camera);
}
else
{
Debug.Log("Camera CRT is not available: " + reason);
}
Properties
Provider
Gets the registered implementation, or null when no pipeline package provides one.
Declaration
public static ITextModeCRTCameraEffect Provider { get; }
Property Value
| Type | Description |
|---|---|
| ITextModeCRTCameraEffect | The implementation last passed to Register(ITextModeCRTCameraEffect), or null. |
Methods
Register(ITextModeCRTCameraEffect)
Registers the implementation of the active render pipeline package, replacing any earlier one.
Declaration
public static void Register(ITextModeCRTCameraEffect provider)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextModeCRTCameraEffect | provider | The implementation. Null clears the registration. |
Unregister(ITextModeCRTCameraEffect)
Removes an implementation, for example when its render pipeline is no longer active. Nothing happens when another implementation has replaced it in the meantime.
Declaration
public static void Unregister(ITextModeCRTCameraEffect provider)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextModeCRTCameraEffect | provider | The implementation to remove. Null is ignored. |