Runtime
Reset and Step Back
Choose between resetting transient component state, clearing persisted progress, and moving one position back in an active Chapter.
Three operations with different scope
| Operation | Changes | Does not do |
|---|---|---|
| Objective.ResetObjective | Local scene detector state | Does not change ordered state or persisted progress |
| Chapter fresh start | Deletes known progress for that Chapter, resets rows and linked physical Objectives, starts a chosen/first row | Does not clear other Chapters or named states |
| ChapterManager.ClearProgress | Known Chapter, Objective, named state, and handoff records for the current scope/profile | Does not delete arbitrary PlayerPrefs or orphaned removed-content keys |
| Chapter.TryStepBack | Completes current row as a special step, moves one index back, resets previous row and linked detector | Is not a general undo or history stack |
TryStepBack exact contract
The Chapter must be Active, the current index must be at least one, and the supplied ID must match the current Ordered Objective exactly. The method stops pending start work, raises ObjectiveCompleted for the current index, completes the current record with step-back semantics, decrements the index, resets the previous record and its matching scene Objective component, then starts that position again.
Completion actions for the current row run, but the objective success sound is suppressed. Because this is a progression operation, it can persist the current row's terminal state before returning to the previous one. Design a Back button with those effects in mind.
Custom components must reset all transient state
- Call
base.ResetObjective()to clear local accepted completion. - Stop coroutines and timers that could emit a late request.
- Clear counters, branch flags, cached colliders, and one-shot feedback guards.
- Restore project-owned objects separately when they were destroyed, moved, pooled, or visually changed.
- Do not invoke historical completion events during reset.
Included components follow this rule where they own transient data. DestructionObjective cannot resurrect destroyed content; ObjectPlacementObjective clears occupancy but cannot reposition props; ObjectTransportAction keeps no inverse transform.
Test reset and back independently
- 1Complete Objective 01 and make Objective 02 Active.
- 2Call TryStepBack with the exact Objective 02 ID. It must return true and Objective 01 must become Active again.
- 3Repeat at Objective 01: it must return false because no previous position exists.
- 4Reset a scene detector only. Confirm ordered progress does not move.
- 5Start the Chapter fresh and confirm its own persisted rows reset while another Chapter's completion remains.
- 6Clear Progress and verify all currently known rows and boolean states in the profile return to defaults.