Пример #1
0
 public void SessionSlider_OnValueChanged()
 {
     currentSessionIndex = (int)sessionSlider.value;
     if (currentSessionIndex < sessionDataList.Count)
     {
         currentSession = sessionDataList [currentSessionIndex];
         PopulateHeatmap();
         UpdateDay();
     }
 }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        sessionData = dataManager.GetSessionData();

        trainingTime.SetTargetWholeNumber(Mathf.RoundToInt(sessionData.sessionLength));
        aggregateReactionTime.SetTargetDecimalNumber(sessionData.medianReactionTime);

        hitsVis.SetTargetWholeNumber(sessionData.hitCount, 0, (sessionData.hitCount + sessionData.errorCount));
        errorVis.SetTargetWholeNumber((sessionData.hitCount + sessionData.errorCount), sessionData.hitCount, (sessionData.hitCount + sessionData.errorCount));

        hitsText.SetTargetWholeNumber(sessionData.hitCount, 0, (sessionData.hitCount + sessionData.errorCount));
    }
Пример #3
0
    public void Init(string gameType = null, int difficultyLevel = -1)
    {
        Debug.Log("Init called");
        CompleteSessionDataList = dataManager.GetSessionDataList();
        Debug.Log("CompleteSessionDataLength: " + CompleteSessionDataList.Count);

        if (gameType == null && difficultyLevel == -1)
        {
            currentSession  = CompleteSessionDataList[CompleteSessionDataList.Count - 1];
            sessionDataList = CompleteSessionDataList.FindAll(s => s.difficultyLevel == currentSession.difficultyLevel && s.gameType == currentSession.gameType);
        }
        else
        {
            sessionDataList = CompleteSessionDataList.FindAll(s => s.difficultyLevel == difficultyLevel && s.gameType == gameType);
            currentSession  = sessionDataList[sessionDataList.Count - 1];
        }

        currentSessionIndex = sessionDataList.Count - 1;

        Debug.Log("sessionDataListLength: " + sessionDataList.Count);

        if (sessionDataList.Count > 1)
        {
            sessionSlider.gameObject.SetActive(true);
            sessionSlider.minValue = 0;
            sessionSlider.maxValue = sessionDataList.Count - 1;
            sessionSlider.value    = sessionDataList.Count - 1;
        }
        else
        {
            sessionSlider.gameObject.SetActive(false);
        }

        currentSession = sessionDataList[currentSessionIndex];
        PopulateHeatmap();
        UpdateDay();
        hasInit = true;
    }