diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineClearShot.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineClearShot.cs index ece596764..fad6650d9 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineClearShot.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineClearShot.cs @@ -45,8 +45,8 @@ public class CinemachineClearShot : CinemachineCameraManagerBase [FormerlySerializedAs("m_RandomizeChoice")] public bool RandomizeChoice = false; - [SerializeField, HideInInspector, FormerlySerializedAs("m_LookAt")] Transform m_LegacyLookAt; - [SerializeField, HideInInspector, FormerlySerializedAs("m_Follow")] Transform m_LegacyFollow; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_LookAt")] Transform m_LegacyLookAt; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_Follow")] Transform m_LegacyFollow; float m_ActivationTime = 0; float m_PendingActivationTime = 0; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs index ac88bb7c2..e7678126d 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs @@ -124,7 +124,7 @@ class VcamExtraState : VcamExtraStateBase List m_ExtraStateCache; ShapeCache m_ShapeCache; - [SerializeField, HideInInspector, FormerlySerializedAs("m_MaxWindowSize")] + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_MaxWindowSize")] float m_LegacyMaxWindowSize = -2; // -2 means there's no legacy upgrade to do const float k_CornerAngleThreshold = 10f; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineSequencerCamera.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineSequencerCamera.cs index 5a123a424..852ae6f1b 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineSequencerCamera.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineSequencerCamera.cs @@ -53,8 +53,8 @@ public struct Instruction [FormerlySerializedAs("m_Instructions")] public List Instructions = new (); - [SerializeField, HideInInspector, FormerlySerializedAs("m_LookAt")] Transform m_LegacyLookAt; - [SerializeField, HideInInspector, FormerlySerializedAs("m_Follow")] Transform m_LegacyFollow; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_LookAt")] Transform m_LegacyLookAt; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_Follow")] Transform m_LegacyFollow; float m_ActivationTime = -1; // The time at which the current instruction went live int m_CurrentInstruction = 0; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineCart.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineCart.cs index b4c31430a..5761c773f 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineCart.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineCart.cs @@ -77,9 +77,9 @@ public PathIndexUnit PositionUnits // In-editor only: CM 3.0.x Legacy support ================================= - [SerializeField, HideInInspector, FormerlySerializedAs("SplinePosition")] private float m_LegacyPosition = -1; - [SerializeField, HideInInspector, FormerlySerializedAs("PositionUnits")] private PathIndexUnit m_LegacyUnits; - [SerializeField, HideInInspector, FormerlySerializedAs("Spline")] private SplineContainer m_LegacySpline; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("SplinePosition")] private float m_LegacyPosition = -1; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("PositionUnits")] private PathIndexUnit m_LegacyUnits; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("Spline")] private SplineContainer m_LegacySpline; void PerformLegacyUpgrade() { if (m_LegacyPosition != -1) diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineStateDrivenCamera.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineStateDrivenCamera.cs index 169e2e400..8cc9b3c23 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineStateDrivenCamera.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineStateDrivenCamera.cs @@ -81,7 +81,7 @@ internal struct ParentHash public int HashOfParent; } /// Internal API for the Inspector editor - [HideInInspector][SerializeField] private List HashOfParent = new(); + [HideInInspector, SerializeField, NoSaveDuringPlay] private List HashOfParent = new(); /// Internal API for the Inspector editor internal void SetParentHash(List list) @@ -90,8 +90,8 @@ internal void SetParentHash(List list) HashOfParent.AddRange(list); } - [SerializeField, HideInInspector, FormerlySerializedAs("m_LookAt")] Transform m_LegacyLookAt; - [SerializeField, HideInInspector, FormerlySerializedAs("m_Follow")] Transform m_LegacyFollow; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_LookAt")] Transform m_LegacyLookAt; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("m_Follow")] Transform m_LegacyFollow; float m_ActivationTime = 0; int m_ActiveInstructionIndex; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineTargetGroup.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineTargetGroup.cs index 7a3e57f73..a7a899ed9 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineTargetGroup.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineTargetGroup.cs @@ -174,7 +174,7 @@ void Reset() //============================================ // Legacy support - [HideInInspector, SerializeField, FormerlySerializedAs("m_Targets")] + [HideInInspector, SerializeField, NoSaveDuringPlay, FormerlySerializedAs("m_Targets")] Target[] m_LegacyTargets; void Awake() diff --git a/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs b/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs index c24c14d10..c61279a89 100644 --- a/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs +++ b/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs @@ -113,9 +113,9 @@ public struct DampingSettings CinemachineSplineRoll.RollCache m_RollCache; // In-editor only: CM 3.0.x Legacy support ================================= - [SerializeField, HideInInspector, FormerlySerializedAs("CameraPosition")] private float m_LegacyPosition = -1; - [SerializeField, HideInInspector, FormerlySerializedAs("PositionUnits")] private PathIndexUnit m_LegacyUnits; - [SerializeField, HideInInspector, FormerlySerializedAs("Spline")] private SplineContainer m_LegacySpline; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("CameraPosition")] private float m_LegacyPosition = -1; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("PositionUnits")] private PathIndexUnit m_LegacyUnits; + [SerializeField, HideInInspector, NoSaveDuringPlay, FormerlySerializedAs("Spline")] private SplineContainer m_LegacySpline; void PerformLegacyUpgrade() { if (m_LegacyPosition != -1) diff --git a/com.unity.cinemachine/Runtime/Core/CinemachineVirtualCameraBase.cs b/com.unity.cinemachine/Runtime/Core/CinemachineVirtualCameraBase.cs index afc5cdaa9..73d41a8a2 100644 --- a/com.unity.cinemachine/Runtime/Core/CinemachineVirtualCameraBase.cs +++ b/com.unity.cinemachine/Runtime/Core/CinemachineVirtualCameraBase.cs @@ -162,7 +162,7 @@ internal protected virtual void PerformLegacyUpgrade(int streamedVersion) } } - [HideInInspector, SerializeField, FormerlySerializedAs("m_Priority")] + [HideInInspector, SerializeField, NoSaveDuringPlay, FormerlySerializedAs("m_Priority")] int m_LegacyPriority = 0; //============================================================================ diff --git a/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseListener.cs b/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseListener.cs index 879d4eed5..2f39439e5 100644 --- a/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseListener.cs +++ b/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseListener.cs @@ -99,7 +99,7 @@ public struct ImpulseReaction bool m_Initialized; - [SerializeField, HideInInspector] + [SerializeField, HideInInspector, NoSaveDuringPlay] Vector3 m_NoiseOffsets; /// Generate a new random seed diff --git a/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs b/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs index e800a6ff2..8a4d30560 100644 --- a/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs +++ b/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs @@ -77,7 +77,7 @@ public enum FocusTrackingMode CustomPassVolume m_CustomPassVolume; /// Serialized so that the compute shader is included in the build. - [SerializeField] + [SerializeField, NoSaveDuringPlay] ComputeShader m_ComputeShader; void OnDisable()