Skip to content

Instantly share code, notes, and snippets.

public void StartSession()
{
LootLockerSDKManager.StartGuestSession((response) =>
{
if (!response.success)
{
Debug.Log("Error starting LootLocker session");
return;
}
public void GetCorrectWordsFromCloud(int fileIndex)
{
string[] list = new string[] { "89852" };
LootLockerSDKManager.GetAssetsById(list, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved " + response.assets.Length + " assets");
Debug.Log("First Asset ID: " + response.assets[0].id);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LootLocker.Requests;
using System;
using System.Net;
using System.Text.RegularExpressions;
using UnityEngine.Networking;
public bool playerLoggedIn;
public bool hasWordList;
public string wordList;
string randomWord = guessingWords[Rand.RandomRange(playerManager.GetInternetTimeSeed(), 0, guessingWords.Count)];
string randomWord = guessingWords[Random.Range(0, guessingWords.Count)];
public class GameController : MonoBehaviour
{
// Reference to PlayerManager
public PlayerManager playerManager;
// List with all the words
private List<string> dictionary = new List<string>();
using System;
public static class Rand
{
public static int RandomRange(UInt32 seed, int min, int max)
{
// Shift around
seed ^= seed << 21;
seed ^= seed >> 35;
seed ^= seed << 4;
// Re-write this function when we have an endpoint for time, not working with WebGL
public UInt32 GetInternetTimeSeed()
{
// Make a request to a website
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("https://lootlocker.io");
// Save the response
WebResponse response = myHttpWebRequest.GetResponse();
// Save today's date to a string
string originalDate = response.Headers["date"];
string dateSeed = "";
string[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Feb" };