# Frameplay API

# Unity Scripts

# Create a Player

/// <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)

/// Creates a new player with user input values and allows data collection
/// </summary>
/// <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, Gender gender, SystemLanguage language, string id = "")

# Start a Frameplay Session

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


/// <summary>
/// Initialise Frameplay SDK Session
/// Reference the Frameplay Data Asset here to load as part of the Scene or Prefab.
/// If this property is left empty, the Data Asset will be loaded using Resources.Load
/// </summary>
/// <param name="dataAsset">Scriptable object loaded with the Scene or Prefab</param>
/// <param name="player">Frameplay Player class optionally containing age, Gender, Language etc.</param>
/// <param name="camera">Camera object to be registered for tracking</param>
public static void StartSession(FrameplayDataAsset dataAsset, Player player, Camera camera)

# Register a Camera







 

/// <summary>
/// Register a Camera object for position tracking and Ad Space activation detection
/// Note. Only one camera can be tracked at any given time
/// Creates a component and trigger collider on the given object
/// </summary>
/// <param name="camera">Camera Object</param>
void RegisterCamera(UnityEngine.Camera camera)

# Unregister a Camera




 

/// <summary>
/// Unregister the currently registered Camera object. Pauses all metrics and future advertisements from /// being loaded.
/// </summary>
void UnregisterCamera()

# Get the Registered Camera





 

/// <summary>
/// Get currently registered camera
/// </summary>
/// <returns>The currently registered camera. Null if none are registered.</returns>
UnityEngine.Camera GetRegisteredCamera()

# Has the Session Started?




 

/// <summary>
/// Has SDK session successfully started
/// </summary>
bool SessionStarted

# Is a Camera Registered?





 

/// <summary>
/// Is a camera currently registered
/// </summary>
/// <returns>True if a camera is currently registered.</returns>
bool IsCameraRegistered()

# FrameplayAdSpace

/// <summary>
/// Unique identifier generated when the Ad Space is registered.
/// Field is shown on the Developer Dashboard
/// </summary>
public string AdSpaceId;

/// <summary>
/// Used to identify the Ad Space.
/// Field is shown on the Developer Dashboard
/// </summary>
public string Description;

/// <summary>
/// Advertisements of this ratio will be displayed on this Ad Space.
/// When scaling the Ad Space in Editor, this ratio will be enforced.
/// Field is shown on the Developer Dashboard
/// </summary>
public ImageRatio Ratio;

/// <summary>
/// A Paused Ad Space will remain in it's 'Placeholder' state, and will not
/// request Ads.
/// </summary>
public bool Paused

/// <summary>
/// A Dynamic Ad Space will refresh with a new advertisement every 60 seconds.
/// A Static Ad Space will hold the first advertisement they load for the
/// duration of the Frameplay Session or until destroyed.
/// Field is shown on the Developer Dashboard.
/// </summary>
public RefreshType RefreshType;

/// <summary>
/// Optional activation collider
/// </summary>
public Collider ActivationCollider;

/// <summary>
/// If no advertisement is currently displayed and
/// if unchecked the Ad Space will be invisible.
/// If checked however, the Ad Space will be visible and
/// will display the PlaceHolderMaterial
/// </summary>
public bool PlaceholderVisibleDuringPlay;

/// <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>
/// The material used when displaying an advertisement.
/// Texture is overridden to display advertisements
/// </summary>
public Material AdMaterial;

/// <summary>
/// Scale multiplier for downloaded ad texture size.
/// </summary>
public TextureQualityMultiplier AdTextureScaleMultiplier;

/// <summary>
/// Event fired when new Ad content has loaded.
/// </summary>
public UnityEvent OnAdLoaded;

/// <summary>
/// Returns a copy of the current synchronized Ad Space List.
/// </summary>
/// <returns></returns>
public List<AdSpaceSynchronized> GetSynchronizedAdSpaces();

# AdSpaceSynchronized

/// <summary>
/// Synced Ad Space configuration is inherited from the Parent Ad Space.
/// A parent is required for displaying advertisements.
/// </summary>
public FrameplayAdSpace ParentAdSpace;

/// <summary>
/// A unique ID that links this object to the Frameplay platform.
/// Is based on the parents ID.
/// </summary>
public string AdSpaceId;

/// <summary>
/// Ad space mesh renderer
/// </summary>
public MeshRenderer MeshRenderer;

/// <summary>
/// If no advertisement is currently displayed and
/// if unchecked the Ad Space will be invisible.
/// If checked however, the Ad Space will be visible and
/// will display the PlaceHolderMaterial
/// </summary>
public bool PlaceholderVisibleDuringPlay;

/// <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;
Last Updated: 9/7/2020, 3:58:44 AM