public void Update() { if (theOrbitCam != null) { if (Input.GetKeyUp(KeyCode.K)) { theOrbitCamData = theOrbitCam.SaveSettings(); } if (Input.GetKeyUp(KeyCode.L) && theOrbitCamData != null) { theOrbitCam.LoadSettings(theOrbitCamData); } } }
public KGFOrbitCamData SaveSettings() { KGFOrbitCamData aData = new KGFOrbitCamData(); aData.itsRoot.itsTarget = itsTarget.itsTarget; aData.itsRoot.itsFollowPosition = itsTarget.itsFollowPosition; aData.itsRoot.itsPositionSpeed = itsTarget.itsPositionSpeed; aData.itsRoot.itsFollowRotation = itsTarget.itsFollowRotation; aData.itsRoot.itsRotationSpeed = itsTarget.itsRotationSpeed; aData.itsZoom.itsMinLimit = itsZoom.itsMinLimit; aData.itsZoom.itsMaxLimit = itsZoom.itsMaxLimit; aData.itsZoom.itsEnable = itsZoom.itsEnable; aData.itsZoom.itsStartValue = itsZoom.itsStartValue; aData.itsZoom.itsUseLimits = itsZoom.itsUseLimits; aData.itsZoom.itsZoomSpeed = itsZoom.itsZoomSpeed; aData.itsRotation.itsHorizontal.itsLeftLimit = itsRotation.itsHorizontal.itsLeftLimit; aData.itsRotation.itsHorizontal.itsRightLimit = itsRotation.itsHorizontal.itsRightLimit; aData.itsRotation.itsHorizontal.itsStartValue = itsRotation.itsHorizontal.itsStartValue; aData.itsRotation.itsHorizontal.itsEnable = itsRotation.itsHorizontal.itsEnable; aData.itsRotation.itsHorizontal.itsUseLimits = itsRotation.itsHorizontal.itsUseLimits; if(itsRotation.itsHorizontal.itsControls != null) { if(itsRotation.itsHorizontal.itsControls.Length != 0) { aData.itsRotation.itsHorizontal.itsControls = itsRotation.itsHorizontal.itsControls; } } aData.itsRotation.itsVertical.itsDownLimit = itsRotation.itsVertical.itsDownLimit; aData.itsRotation.itsVertical.itsUpLimit = itsRotation.itsVertical.itsUpLimit; aData.itsRotation.itsVertical.itsStartValue = itsRotation.itsVertical.itsStartValue; aData.itsRotation.itsVertical.itsEnable = itsRotation.itsVertical.itsEnable; aData.itsRotation.itsVertical.itsUseLimits = itsRotation.itsVertical.itsUseLimits; if(itsRotation.itsVertical.itsControls != null) { if(itsRotation.itsVertical.itsControls.Length != 0) { aData.itsRotation.itsVertical.itsControls = itsRotation.itsVertical.itsControls; } } aData.itsPanning.itsLeftRight.itsEnable = itsPanning.itsLeftRight.itsEnable; if(itsPanning.itsLeftRight.itsControls != null) { if(itsPanning.itsLeftRight.itsControls.Length != 0) { aData.itsPanning.itsLeftRight.itsControls = itsPanning.itsLeftRight.itsControls; } } aData.itsPanning.itsForwardBackward.itsEnable = itsPanning.itsForwardBackward.itsEnable; if(itsPanning.itsForwardBackward.itsControls != null) { if(itsPanning.itsForwardBackward.itsControls.Length != 0) { aData.itsPanning.itsForwardBackward.itsControls = itsPanning.itsForwardBackward.itsControls; } } aData.itsPanning.itsUpDown.itsEnable = itsPanning.itsUpDown.itsEnable; if(itsPanning.itsUpDown.itsControls != null) { if(itsPanning.itsUpDown.itsControls.Length != 0) { aData.itsPanning.itsUpDown.itsControls = itsPanning.itsUpDown.itsControls; } } aData.itsEnvironment.itsTestCollisions = itsEnvironment.itsTestCollisions; aData.itsEnvironment.itsCollisionLayer = itsEnvironment.itsCollisionLayer; aData.itsEnvironment.itsCollisionOffset = itsEnvironment.itsCollisionOffset; aData.itsEnvironment.itsFollowGround = itsEnvironment.itsFollowGround; aData.itsLookat.itsEnable = itsLookat.itsEnable; aData.itsLookat.itsLookatTarget = itsLookat.itsLookatTarget; aData.itsLookat.itsLookatSpeed = itsLookat.itsLookatSpeed; aData.itsLookat.itsUpVectorSource = itsLookat.itsUpVectorSource; aData.itsLookat.itsHardLinkToTarget = itsLookat.itsHardLinkToTarget; aData.itsCurrentZoom = GetZoomCurrent(); aData.itsTargetZoom = GetZoom(); aData.itsCurrentRotationLeftRight = GetRotationHorizontalCurrent(); aData.itsTargetRotationLeftRight = GetRotationHorizontal(); aData.itsCurrentRotationUpDown = GetRotationVerticalCurrent(); aData.itsTargetRotationUpDown = GetRotationVertical(); aData.itsCurrentLookatPosition = GetLookatPositionCurrent(); return aData; }
public void LoadSettings(KGFOrbitCamData theData) { SetTarget(theData.itsRoot.itsTarget); SetTargetFollowPosition (theData.itsRoot.itsFollowPosition); SetTargetFollowRotation (theData.itsRoot.itsFollowRotation); SetTargetFollowPositionSpeed (theData.itsRoot.itsPositionSpeed); SetTargetFollowRotationSpeed (theData.itsRoot.itsRotationSpeed); SetZoomMinLimit (theData.itsZoom.itsMinLimit); SetZoomMaxLimit (theData.itsZoom.itsMaxLimit); SetZoom (theData.itsTargetZoom); SetZoomEnable(theData.itsZoom.itsEnable); SetZoomUseLimits (theData.itsZoom.itsUseLimits); SetZoomSpeed (theData.itsZoom.itsZoomSpeed); SetZoomStartValue(theData.itsZoom.itsStartValue); SetZoomControls(theData.itsZoom.itsControls); SetRotationHorizontalLeftLimit (theData.itsRotation.itsHorizontal.itsLeftLimit); SetRotationHorizontalRightLimit (theData.itsRotation.itsHorizontal.itsRightLimit); SetRotationHorizontal (theData.itsTargetRotationLeftRight); SetRotationHorizontalEnable (theData.itsRotation.itsHorizontal.itsEnable); SetRotationHorizontalUseLimits (theData.itsRotation.itsHorizontal.itsUseLimits); SetRotationHorizontalStartValue(theData.itsRotation.itsHorizontal.itsStartValue); SetRotationHorizontalControls(theData.itsRotation.itsHorizontal.itsControls); SetRotationVerticalDownLimit (theData.itsRotation.itsVertical.itsDownLimit); SetRotationVerticalUpLimit(theData.itsRotation.itsVertical.itsUpLimit); SetRotationVertical (theData.itsTargetRotationUpDown); SetRotationVerticalEnable (theData.itsRotation.itsVertical.itsEnable); SetRotationVerticalUseLimits(theData.itsRotation.itsVertical.itsUseLimits); SetRotationVerticalStartValue(theData.itsRotation.itsVertical.itsStartValue); SetRotationVerticalControls(theData.itsRotation.itsVertical.itsControls); SetPanningLeftRightEnable(theData.itsPanning.itsLeftRight.itsEnable); SetPanningLeftRightControls(theData.itsPanning.itsLeftRight.itsControls); SetPanningForwardBackwardEnable(theData.itsPanning.itsForwardBackward.itsEnable); SetPanningForwardBackwardControls(theData.itsPanning.itsForwardBackward.itsControls); SetPanningUpDownEnable(theData.itsPanning.itsUpDown.itsEnable); SetPanningUpDownControls(theData.itsPanning.itsUpDown.itsControls); SetEnviromentTestCollisionsEnable (theData.itsEnvironment.itsTestCollisions); SetEnviromentCollisionLayers (theData.itsEnvironment.itsCollisionLayer); SetEnviromentCollisionOffset (theData.itsEnvironment.itsCollisionOffset); SetEnviromentFollowGroundEnable (theData.itsEnvironment.itsFollowGround); // SetHoritzontalAxisInvert (theData.itsRotation.itsHorizontal.itsInvertAxis); // SetVerticalAxisInvert(theData.itsRotation.itsVertical.itsInvertAxis); // SetHorizontalAxisName(theData.itsRotation.itsHorizontal.itsAxisName); // SetVerticalAxisName(theData.itsRotation.itsVertical.itsAxisName); // SetZoomAxisName(theData.itsZoom.itsAxisName); // SetHoritzontalAxisSensitivity(theData.itsRotation.itsHorizontal.itsAxisSensitivity); // SetVerticalAxisSensitivity(theData.itsRotation.itsVertical.itsAxisSensitivity); // SetXAxisSensitivityTouch(theData.itsRotation.itsHorizontal.itsAxisSensitivityTouch); // SetYAxisSensitivityTouch(theData.itsRotation.itsVertical.itsAxisSensitivityTouch); // SetTwoFingerRotateTouch(theData.itsGlobalSettings.itsTwoFingerRotateTouch); // SetZoomAxisSensitivity(theData.itsZoom.itsAxisSensitivity); SetLookatEnable(theData.itsLookat.itsEnable); SetLookatTarget (theData.itsLookat.itsLookatTarget); SetLookatSpeed (theData.itsLookat.itsLookatSpeed); SetLookatUpVectorSource (theData.itsLookat.itsUpVectorSource); SetLookatHardLinkToTarget(theData.itsLookat.itsHardLinkToTarget); }