//--------------------------------------------------- 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) ); } }
/// <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]); }
public void SetValueToNote(Score.Type _type, float _value) { myScore.notes[(int)_type] = _value; }