Namespace
using CameraObjectFader;
Class: CameraFadeController
The main controller component. Attach this to your camera.
Public Properties (Singleton)
| Property | Description | Example |
|---|
static CameraFadeController Instance | The global access point for the controller. | CameraFadeController.Instance.SetTarget(...); |
Public Methods
| API | Function | Example |
|---|
SetTarget(Transform) | Clears all current targets and sets a single new target. | CameraFadeController.Instance.SetTarget(player.transform); |
AddTarget(Transform) | Adds a target to the list without removing existing ones. Does nothing if the target is null or already in the list. | CameraFadeController.Instance.AddTarget(companion.transform); |
RemoveTarget(Transform) | Removes a specific target from the list. | CameraFadeController.Instance.RemoveTarget(deadCharacter.transform); |
ClearTargets() | Removes all targets. Fading operations will stop until new targets are added. | CameraFadeController.Instance.ClearTargets(); |
Public Events (UnityEvent)
| Event | Description | Example |
|---|
onObstructionStart | Invoked when at least one object starts obstructing the view. | Instance.onObstructionStart.AddListener(OnBlocked); |
onObstructionEnd | Invoked when all obstructions are cleared and fading is complete. | Instance.onObstructionEnd.AddListener(OnCleared); |
Class: FadeableObject
Automatically added to objects that need fading. You typically don’t interact with this class directly, but it is public if needed.
Public Properties
| Property | Type | Description |
|---|
fadeChildren | bool | Whether child renderers are included in the fade effect. |
Public Methods
| API | Function | Notes |
|---|
Initialize() | Finds all renderers and stores original materials. | Called automatically. |
SetFadeTarget(float, float) | Sets the target alpha and fade speed. | Called by CameraFadeController. |
ManualUpdate(float) | Updates the fading interpolation. Returns false when fully restored. | N/A |
Class: FaderIgnore
A simple marker component. Objects with this component are never faded.
Has no public methods or properties - its presence is the only requirement.