コード例 #1
0
        //---------------------------------------------------

        public void AddScore(Score.Type scoreType)
        {
            if (!this.isRunning)
            {
                return;
            }

            int additionalScore = Score.GetScore(scoreType);

            this.score = Mathf.Clamp(this.score + additionalScore, Score.MinScore, Score.MaxScore);

            this.UpdateScoreText(this.score);

            SIGVerseLogger.Info("Score (grasp) add [" + Score.GetScore(scoreType) + "], Challenge " + HumanNaviConfig.Instance.numberOfTrials + " Score=" + this.score);

            // Send the Score Notification
            ScoreStatus scoreStatus = new ScoreStatus(additionalScore, this.score, HumanNaviConfig.Instance.GetTotalScore());

            foreach (GameObject scoreNotificationDestination in this.scoreNotificationDestinations)
            {
                ExecuteEvents.Execute <IScoreHandler>
                (
                    target: scoreNotificationDestination,
                    eventData: null,
                    functor: (reciever, eventData) => reciever.OnScoreChange(scoreStatus)
                );
            }
        }
コード例 #2
0
    /// <summary>
    /// Update a note then return
    /// </summary>
    public float UpdateNote(Score.Type _type)
    {
        // reset
        myScore.notes[(int)_type] = 0;

        // calcul it
        foreach (Score.Error error in myScore.listError)
        {
            if (error.type == _type)
            {
                AddValueToNote(error.type, -myScore.GetErrorValue(error.type, error.ID));
            }
        }

        return(myScore.notes[(int)_type]);
    }
コード例 #3
0
 public void SetValueToNote(Score.Type _type, float _value)
 {
     myScore.notes[(int)_type] = _value;
 }