Assets/_MolcaSDK/_VR/Scripts/Scenario/Scoring/ScoringConfig.cs
Aggregation layers
ScoringConfig instances are used at step, activity, and scenario levels:
See Step scoring auxiliary, Activity scoring, and Scenario scoring.
ScoringType
None, PointValue, Binary, TimeBonus, TimePenalty, Countdown, Accuracy.
Shared tuning: scoreMultiplier, allowNegativeScore.
Implementation detail
UseCalculateScore(float timeTaken, float accuracy = 1f) as the single source of truth for formulas. Inspect Type (the active ScoringType) and type-specific fields: basePoints, correctPoints / incorrectPoints (Binary treats accuracy >= 0.5 as correct), time windows for TimeBonus, pointsPerSecond for TimePenalty / Countdown, minPoints / maxPoints, then scoreMultiplier and allowNegativeScore clamp.
IsTimeBased() is true for TimeBonus, TimePenalty, and Countdown. GetMaxPossibleScore() returns an upper bound for UI caps.
When to use
EmbedScoringConfig (serialized class, not necessarily a standalone asset) wherever scoring is configured: StepScoringAuxiliary, ActivityScoring, ScenarioScoring. Choose None when the layer should not contribute numeric score but you still want a placeholder in the Inspector.
Troubleshooting
- Scores always zero — Type may be None; or time-based config has
maxPoints/ windows set so the formula yields 0 at currenttimeTaken/accuracy. - Binary feels inverted — Accuracy is 0–1: use
StepScoringAuxiliary.SetCorrect/SetIncorrect(orSetResult(bool)) soCalculateScoretreats correct as 0.5 and above and incorrect below 0.5. - Unexpected negatives — Enable
allowNegativeScoreor raiseminPoints/ adjust TimePenalty rate; final value is still multiplied byscoreMultiplier.
Unity Editor
Embedded ScoringConfig on StepScoringAuxiliary or standalone asset if you use ScriptableObject variants.
