API REFERENCE
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.