コード例 #1
0
    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;
        }
    }
コード例 #2
0
 void OnSceneUnloaded(Scene scene)
 {
     if (playableScenes.Contains(scene.name))
     {
         //Debug.Log("Telemetry: Ending new Round for scene: " + scene.name);
         this.isRoundRunning = false;
         TelemetryCore.endRound();
     }
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
ファイル: Telemetry.cs プロジェクト: LUDES-PESC/telemetry
    static public int createSingleEvent(string name, Vector3 position, ExpandoObject extraInfo = null)
    {
        TelemetryNode newSingleEvent = new TelemetryNode(
            TelemetryNodeType.SingleEvent,
            name,
            position,
            extraInfo
            );

        return(TelemetryCore.addNode(newSingleEvent));
    }
コード例 #5
0
    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()));
        }
    }
コード例 #6
0
ファイル: DBFirebase.cs プロジェクト: LUDES-PESC/telemetry
 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());
         }
     });
 }
コード例 #7
0
ファイル: Telemetry.cs プロジェクト: LUDES-PESC/telemetry
    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));
    }
コード例 #8
0
    void Update()
    {
        if (loadInfo)
        {
            TelemetryCore.loadSessionsData("Users");
            loadInfo = false;
        }

        if (read)
        {
            if (TelemetryCore.getSessionsData() != null)
            {
                clear();
                setup(TelemetryCore.getSessionsData());
            }
            read = false;
        }
    }
コード例 #9
0
    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);
    }