logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IGameCameraSwitchHolds

    The shared record of which scene volumes are holding a camera switched on. Every volume that switches to a camera takes a hold on it, and the camera is handed back only when the last hold on it is released, so two entrances to one arena that switch to the same camera never undo each other's switch.

    Namespace: Serenity.GameCamera.Application.Interfaces
    Assembly: Serenity.GameCamera.Application.dll
    Syntax
    public interface IGameCameraSwitchHolds
    Remarks

    One instance per running game, published beside IGameCameraService by the Game Camera module. Camera handles are opaque objects, as on IGameCameraService. The first hold on a camera remembers what handing it back means: the camera that was active before, and whether the switched camera was on and known to the camera service. A hold is counted per holder, not per visitor: a volume takes one hold when its first visitor walks in and releases it when its last visitor leaves.

    Methods

    Acquire(object)

    Makes targetCamera the only active camera and adds one hold on it.

    Declaration
    void Acquire(object targetCamera)
    Parameters
    Type Name Description
    object targetCamera

    Opaque handle to the engine camera to switch to.

    Release(object, bool)

    Removes one hold on targetCamera. Releasing the last hold with restorePrevious set makes the camera that was active before the first hold active again and hands the switched camera back as it was — unless another camera was chosen meanwhile, which then stays. Releasing a camera that has no hold does nothing.

    Declaration
    void Release(object targetCamera, bool restorePrevious)
    Parameters
    Type Name Description
    object targetCamera

    Opaque handle to the engine camera the hold was taken on.

    bool restorePrevious

    Whether releasing the last hold restores the camera active before it.

    In this article
    © 2026 Serenity. All Rights Reserved