# Session & Cameras

Here we cover the Frameplay Session & Registered Camera in Unity.

For more information on Frameplay Sessions, Cameras and best practices see our Developer Guidelines.

# Starting a Session

Start a Frameplay Session by calling Frameplay.StartSession(). This only needs to be called once, ideally at launch.

Follow the Install Guide to use our "StartSession.cs" example script.

The StartSession() parameters are as follows:

  • Frameplay Data Asset (Required): This is a reference to the Frameplay Data Asset. This can be referenced by a Game Object in the Scene (StartSession.cs example), loaded using Resources or Asset Bundles.

  • Player Data (Optional): If available, the players Age and Sex should be passed as parameters to the StartSession call. These can be sourced from a client API or a custom login. This data allows for targeted advertisements.

  • Action Delegate (Optional): Action called when the Frameplay session has successfully started. Typically used for registering a camera once the SDK is initialized.

# Registered Cameras

The Frameplay Session requires a reference to a Unity Camera. This should be called each time the active camera changes.

The camera is used for gathering metrics and activating advertisements colliders. Only one Camera Object can be registered at any one time. They can be registered and unregistered when required.

# Register

Register a Unity Camera object by calling Frameplay.RegisterCamera(). The easiest way to do this is to use the StartSession callback parameter.

Frameplay.RegisterCamera() parameters are as follows:

# Unregister

Unregister a camera by calling Frameplay.UnregisterCamera() from a Unity Script. There are no parameters required.

More information on the Frameplay API.

Last Updated: 8/31/2020, 2:21:41 AM