void Update() { if (this.detectSceneName) { this.sceneName = SceneManager.GetActiveScene().name; } if (loadInfo) { TelemetryCore.loadSessionsData("Users"); loadInfo = false; isReading = true; } if (isReading) { if (TelemetryCore.getSessionsData() != null) { clearData(); setup(TelemetryCore.getSessionsData()); } isReading = false; } if (draw) { clearScene(); render(); draw = false; } }
void OnSceneUnloaded(Scene scene) { if (playableScenes.Contains(scene.name)) { //Debug.Log("Telemetry: Ending new Round for scene: " + scene.name); this.isRoundRunning = false; TelemetryCore.endRound(); } }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (playableScenes.Contains(scene.name)) { //Debug.Log("Telemetry: Starting new Round for scene: " + scene.name); this.isRoundRunning = true; TelemetryCore.newRound(scene.name); } }
static public int createSingleEvent(string name, Vector3 position, ExpandoObject extraInfo = null) { TelemetryNode newSingleEvent = new TelemetryNode( TelemetryNodeType.SingleEvent, name, position, extraInfo ); return(TelemetryCore.addNode(newSingleEvent)); }
void OnApplicationQuit() { if (this.isRoundRunning) { // If round didn't finish yet, ends it TelemetryCore.endRound(); } TelemetryCore.setPlayerInfo("Session Duration", Time.realtimeSinceStartup); if (isSavingActivated) { DBHandler.saveSessionsData(JsonConvert.SerializeObject(TelemetryCore.getPlayerInfo())); } }
public void loadSessionsData(string key) { FirebaseDatabase.DefaultInstance .GetReference(key) .GetValueAsync().ContinueWith(task => { if (task.IsFaulted) { Debug.Log("Could not load session data"); } else if (task.IsCompleted) { DataSnapshot snapshot = task.Result; TelemetryCore.setSessionsData(snapshot.GetRawJsonValue()); } }); }
static public int createChainEvent(string name, Vector3 position, int previousEventId = -1, ExpandoObject extraInfo = null) { TelemetryNode newChainEvent = new TelemetryNode( TelemetryNodeType.ChainEvent, name, position, extraInfo ); if (previousEventId != -1) { newChainEvent.setLink(previousEventId); } // Telemetry: Save the event node ID return(TelemetryCore.addNode(newChainEvent)); }
void Update() { if (loadInfo) { TelemetryCore.loadSessionsData("Users"); loadInfo = false; } if (read) { if (TelemetryCore.getSessionsData() != null) { clear(); setup(TelemetryCore.getSessionsData()); } read = false; } }
void track() { dynamic additionalMetaData = new ExpandoObject(); additionalMetaData.looking = transform.lossyScale.x > 0 ? "right" : "left"; TelemetryNode playerPosition = new TelemetryNode( TelemetryNodeType.Atomic, "Player Position", transform.position, additionalMetaData ); if (lastPositionId != -1) { playerPosition.setLink(lastPositionId); } lastPositionId = TelemetryCore.addNode(playerPosition); }