# Frameplay API

# Session

# Create a Player Struct

Assets/FrameplaySDK/Core/Player/Player.cs

/// <summary>
/// Creates a new player with default values.
/// </summary>
public Player()

/// <summary>
/// Creates a new player with no data collection
/// </summary>
/// <param name="allowDataCollection">Intended for false values</param>
public Player(bool allowDataCollection)

/// </summary>
/// Creates a new player with user input values and allows data collection
/// <param name="age">Player age</param>
/// <param name="gender">Player gender</param>
/// <param name="language">Unity system language</param>
/// <param name="id">Player tag (ex. "[ReB]", "Gamer")</param>
public Player(int age = -1, Gender gender = Gender.Unknown,
  FrameplaySystemLanguage language = FrameplaySystemLanguage.Unknown, string id = "")

# Start a Frameplay Session

Assets/FrameplaySDK/Frameplay.cs

/// <summary>
/// Initialise Frameplay SDK Session
/// The Data Asset will be loaded using Resources.Load
/// </summary>
/// <param name="camera">Camera object to be registered for visibility metrics</param>
/// <param name="player">Frameplay Player class optionally containing age,
/// Gender, Language etc.
/// </param>
public static void Start(Camera? camera, Player? player = null)

# Stop a Frameplay Session

/// <summary>
/// Stop the active Frameplay SDK Session
/// </summary>
public static void Stop()

# Set a Camera

/// <summary>
/// Set a Camera object for Ad Space visibility metrics
/// Note. Only one Camera can be set at any given time.
/// If no camera is set, Camera.main is used.
/// If Camera.main is null, or the set Camera is not Enabled, the
/// Frameplay SDK will stop recording any metrics for the active Ad Spaces.
/// </summary>
/// <param name="camera">Camera Object</param>
void SetCamera(UnityEngine.Camera camera)

# AdSpace

Assets/FrameplaySDK/Engine/Scripts/AdSpace.cs

/// <summary>
/// The configuration that decides what ad content will be downloaded
/// and displayed.  (see below)
/// </summary>
public AdSpaceConfiguration Configuration

/// <summary>
/// Event fired when new ad content has loaded.
/// </summary>
public UnityEvent<AdSpace> AdLoaded;

/// <summary>
/// If true, and there are other active Ad Spaces with the same ContentConfiguration,
/// only download the ad content once and display it synchronized
/// across them all
/// </summary>
public bool SyncChannel

/// <summary>
/// The Material used when displaying an advertisement.
/// Texture is overridden on a copy of the Material to display advertisements
/// </summary>
public Material AdMaterial;

/// <summary>
/// The Material used when there is no advertisement currently displayed.
/// Can be changed to a Material more fitting of your environment
/// </summary>
public Material PlaceholderMaterial;


/// <summary>
/// If SetActivationState(false) is called, the Ad Space will not load ad content.
/// </summary>
public void SetActivationState(bool isActive) =>
public bool UsingAdMaterial { get; private set; }

# AdSpaceConfiguration

Assets/FrameplaySDK/Core/AdSpace/AdSpaceConfiguration.cs

Change the below properties before the Ad Space is loaded.

///<summary>
/// The name of the Ad Space
///</summary>
public string Name;

///<summary>
/// Ad Space's content configuration (see below)
///</summary>
public ContentConfiguration ContentConfig;

///<summary>
/// What Channel the Ad Space is on. Left blank it will be on its own channel
///</summary>
public string ChannelName;

# ContentConfiguration

Assets/FrameplaySDK/Core/AdSpace/ContentConfiguration.cs

All of the ContentConfiguration settings below must match for an Ad Space to be synchronized with other Ad Spaces.

public ImageRatio Ratio;
///<summary>
/// Can be Quarter, Half or Original (the default).
/// Affects download size and in-game memory (VRAM).
///</summary>
public TextureQualityMultiplier QualityMultiplier;
///<summary>
/// Refresh type may be Dynamic (loading new ad content periodically) or
/// Static (never loading different content more than once per Session)
///</summary>
public RefreshType RefreshType;
///<summary>
/// ContentType may be Image, or Image and Video.
/// Only the 16x9 ratio is supported by video.
///</summary>
public AdContentType ContentType;
Last Updated: 9/20/2023, 4:30:42 PM