update
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Invector
|
||||
{
|
||||
public enum TPCameraMode
|
||||
{
|
||||
FreeDirectional,
|
||||
FixedAngle,
|
||||
FixedPoint,
|
||||
FirstPerson
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class vThirdPersonCameraState
|
||||
{
|
||||
@@ -56,6 +64,60 @@ namespace Invector
|
||||
fixedAngle = Vector2.zero;
|
||||
cameraMode = TPCameraMode.FreeDirectional;
|
||||
}
|
||||
|
||||
public void CopyState(vThirdPersonCameraState state)
|
||||
{
|
||||
this.Name = state.Name;
|
||||
this.forward = state.forward;
|
||||
this.right = state.right;
|
||||
this.defaultDistance = state.defaultDistance;
|
||||
this.maxDistance = state.maxDistance;
|
||||
this.minDistance = state.minDistance;
|
||||
this.height = state.height;
|
||||
this.smooth = state.smooth;
|
||||
this.smoothDamp = state.smoothDamp;
|
||||
this.xMouseSensitivity = state.xMouseSensitivity;
|
||||
this.yMouseSensitivity = state.yMouseSensitivity;
|
||||
this.yMinLimit = state.yMinLimit;
|
||||
this.yMaxLimit = state.yMaxLimit;
|
||||
this.xMinLimit = state.xMinLimit;
|
||||
this.xMaxLimit = state.xMaxLimit;
|
||||
this.rotationOffSet = state.rotationOffSet;
|
||||
this.cullingHeight = state.cullingHeight;
|
||||
this.cullingMinDist = state.cullingMinDist;
|
||||
this.fov = state.fov;
|
||||
this.useZoom = state.useZoom;
|
||||
this.fixedAngle = state.fixedAngle;
|
||||
this.lookPoints = state.lookPoints;
|
||||
this.cameraMode = state.cameraMode;
|
||||
}
|
||||
|
||||
public void Slerp(vThirdPersonCameraState state, float t)
|
||||
{
|
||||
this.Name = state.Name;
|
||||
this.forward = Mathf.Lerp(this.forward, state.forward, t);
|
||||
this.right = Mathf.Lerp(this.right, state.right, t);
|
||||
this.defaultDistance = Mathf.Lerp(this.defaultDistance, state.defaultDistance, t);
|
||||
this.maxDistance = Mathf.Lerp(this.maxDistance, state.maxDistance, t);
|
||||
this.minDistance = Mathf.Lerp(this.minDistance, state.minDistance, t);
|
||||
this.height = Mathf.Lerp(this.height, state.height, t);
|
||||
this.smooth = Mathf.Lerp(this.smooth, state.smooth, t);
|
||||
this.smoothDamp = Mathf.Lerp(this.smoothDamp, state.smoothDamp, t);
|
||||
this.xMouseSensitivity = Mathf.Lerp(this.xMouseSensitivity, state.xMouseSensitivity, t);
|
||||
this.yMouseSensitivity = Mathf.Lerp(this.yMouseSensitivity, state.yMouseSensitivity, t);
|
||||
this.yMinLimit = Mathf.Lerp(this.yMinLimit, state.yMinLimit, t);
|
||||
this.yMaxLimit = Mathf.Lerp(this.yMaxLimit, state.yMaxLimit, t);
|
||||
this.xMinLimit = Mathf.Lerp(this.xMinLimit, state.xMinLimit, t);
|
||||
this.xMaxLimit = Mathf.Lerp(this.xMaxLimit, state.xMaxLimit, t);
|
||||
this.rotationOffSet = Vector3.Lerp(this.rotationOffSet, state.rotationOffSet, t);
|
||||
this.cullingHeight = Mathf.Lerp(this.cullingHeight, state.cullingHeight, t);
|
||||
this.cullingMinDist = Mathf.Lerp(this.cullingMinDist, state.cullingMinDist, t);
|
||||
this.fov = Mathf.Lerp(this.fov, state.fov, t);
|
||||
this.useZoom = state.useZoom;
|
||||
this.fixedAngle = Vector2.Lerp(this.fixedAngle, state.fixedAngle, t);
|
||||
this.lookPoints = state.lookPoints;
|
||||
this.cameraMode = state.cameraMode;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
@@ -66,11 +128,4 @@ namespace Invector
|
||||
public Vector3 eulerAngle;
|
||||
public bool freeRotation;
|
||||
}
|
||||
|
||||
public enum TPCameraMode
|
||||
{
|
||||
FreeDirectional,
|
||||
FixedAngle,
|
||||
FixedPoint
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user