This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void StartSession() | |
{ | |
LootLockerSDKManager.StartGuestSession((response) => | |
{ | |
if (!response.success) | |
{ | |
Debug.Log("Error starting LootLocker session"); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using LootLocker.Requests; | |
using System; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using UnityEngine.Networking; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool playerLoggedIn; | |
public bool hasWordList; | |
public string wordList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string randomWord = guessingWords[Rand.RandomRange(playerManager.GetInternetTimeSeed(), 0, guessingWords.Count)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string randomWord = guessingWords[Random.Range(0, guessingWords.Count)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GameController : MonoBehaviour | |
{ | |
// Reference to PlayerManager | |
public PlayerManager playerManager; | |
// List with all the words | |
private List<string> dictionary = new List<string>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Feb" }; |
NewerOlder