public AdvancedClimbingData_v1 GetSaveData() { AdvancedClimbingData_v1 data = new AdvancedClimbingData_v1(); if (DaggerfallUnity.Settings.AdvancedClimbing && isClimbing) { data.isClimbing = isClimbing; data.climbingStartTimer = climbingStartTimer; data.climbingContinueTimer = climbingContinueTimer; data.wallDirection = wallDirection; data.myLedgeDirection = myLedgeDirection; } return(data); }
public void RestoreSaveData(AdvancedClimbingData_v1 data) { if (DaggerfallUnity.Settings.AdvancedClimbing && data.isClimbing) { isClimbing = data.isClimbing; climbingStartTimer = data.climbingStartTimer; climbingContinueTimer = data.climbingContinueTimer; wallDirection = data.wallDirection; myLedgeDirection = data.myLedgeDirection; // Clear some state on restore or a recent climb in same session might trigger improper movement ClearStateOnRestore(); // Show climbing mode message and force enable touching sides until physics reacquires wall contact // Also freeze motor so player doesn't start falling right away showClimbingModeMessage = true; touchingSidesRestoreForce = true; GameManager.Instance.PlayerMotor.FreezeMotor = 1f; } }