// Update is called once per frame void Update() { if (accepted && runOnceFlag) { if (Analytics.Get().SessionSet) { runOnceFlag = false; UIController.Next(); } } }
/* * This code is relevant if you are logging local data */ public void SetLocalSession() { /* * Define and record session parameters for logging to local logs */ string localSessionLocation = "Logs/LastSession.txt"; int sessionID = 0; if (File.Exists(localSessionLocation)) { string s = File.ReadAllText(localSessionLocation); File.Delete(localSessionLocation); sessionID = int.Parse(s); sessionID += 1; } File.WriteAllText(localSessionLocation, sessionID + ""); Session = new GameplaySession(sessionID, 0); SessionSet = true; //Flags that session is now running int condition; if (NumberOfConditions > 0) { condition = UnityEngine.Random.Range(0, NumberOfConditions); } else { condition = 0; } Analytics.Get().Session.AddInfo("Condition", "" + condition); }