public override void RestoreWith(State state) { LeverState leverState = (LeverState)state; leverState.RebuildCompoundTypes(); startRotation = leverState.prevStartRotation; EndRotation = leverState.prevEndRotation; OriginalStartRotation = leverState.originalStartRotation; OriginalEndRotation = leverState.originalEndRotation; MovementDirection = leverState.movementDirection; HasSwitchedRotation = leverState.hasSwitchedRotation; IsRotating = leverState.isRotating; hasInitialised = true; if (IsRotating) { toResumeRotation = true; } if (HasSwitchedRotation) { SwitchRotation(); } }