private void CopyNewCameraSettingsToAllTransitionClips(int t_TransitionIndex, CameraSettings t_NewCameraSettings) { t_NewCameraSettings.focusType = FocusType.Follow; int t_NumberOfClip = Reference.listOfCameraTransations[t_TransitionIndex].transationClips.Count; for (int i = 0; i < t_NumberOfClip; i++) { SerializedProperty t_CameraSettingsOfClip = SP_ListOfCameraTransations.GetArrayElementAtIndex(t_TransitionIndex).FindPropertyRelative("transationClips").GetArrayElementAtIndex(i).FindPropertyRelative("cameraSettings"); CopyCameraSettingsFromOneToAnother(t_CameraSettingsOfClip, t_NewCameraSettings); } }
private void CopyCameraSettingsFromOneToAnother(SerializedProperty t_SerializedCameraSettings, CameraSettings t_NewValue) { t_SerializedCameraSettings.FindPropertyRelative("forwardVelocity").floatValue = t_NewValue.forwardVelocity; t_SerializedCameraSettings.FindPropertyRelative("curveForForwardVelocity").animationCurveValue = t_NewValue.curveForForwardVelocity; t_SerializedCameraSettings.FindPropertyRelative("angulerVelocity").floatValue = t_NewValue.angulerVelocity; t_SerializedCameraSettings.FindPropertyRelative("curveForAngulerVelocity").animationCurveValue = t_NewValue.curveForAngulerVelocity; t_SerializedCameraSettings.FindPropertyRelative("cameraPositionOffset").vector3Value = t_NewValue.cameraPositionOffset; t_SerializedCameraSettings.FindPropertyRelative("cameraFocusOffset").vector3Value = t_NewValue.cameraFocusOffset; t_SerializedCameraSettings.FindPropertyRelative("isUseFocusOffsetOnLocalSpace").boolValue = t_NewValue.isUseFocusOffsetOnLocalSpace; t_SerializedCameraSettings.FindPropertyRelative("focusConstraint").FindPropertyRelative("x").boolValue = t_NewValue.focusConstraint.x; t_SerializedCameraSettings.FindPropertyRelative("focusConstraint").FindPropertyRelative("y").boolValue = t_NewValue.focusConstraint.y; t_SerializedCameraSettings.FindPropertyRelative("focusConstraint").FindPropertyRelative("z").boolValue = t_NewValue.focusConstraint.z; t_SerializedCameraSettings.FindPropertyRelative("focusType").enumValueIndex = (int)t_NewValue.focusType; }