Skip to content

Instantly share code, notes, and snippets.

Last active October 16, 2020 06:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save EliCDavis/2baffde1f470f8234e3e907c43472283 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Recolude;
namespace Example
public class ScoreboardBehavior : MonoBehaviour
RecoludeConfig config;
GameObject scoreHolder;
GameObject scoreEntryPrefab;
void Start()
IEnumerator Search()
var rs = new RecordingService(config);
var req = rs.ListRecordings(new RecordingService.ListRecordingsRequestParams()
// specify this project specifically, because you can actually
// query from multiple projects if you'd like
ProjectId = config.GetProjectID(),
// Order our durations in ascending order, because we want the
// smallest time (fastest) to be presented first.
Order_by = "duration asc",
yield return req.Run();
if (req.success != null)
foreach (var rec in req.success.recordings)
var entryInstance = Instantiate<GameObject>(scoreEntryPrefab,, Quaternion.identity, scoreHolder.transform);
entryInstance.transform.Find("Text_Timestamp").GetComponent<Text>().text = rec.summary.duration.ToString("N2");
entryInstance.transform.Find("Text_Date").GetComponent<Text>().text = rec.summary.CreatedAt.ToString("MMM d, h:mm tt");
entryInstance.transform.Find("Text_Initials").GetComponent<Text>().text =;
.AddListener(() => DoAThing(;
else if (req.fallbackResponse != null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment