浏览代码

added field for camera spawn distance from player

/UI
vjs22334 4 年前
当前提交
7cbd38cc
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 9
      UOP1_Project/Assets/Scripts/CameraManager.cs

9
UOP1_Project/Assets/Scripts/CameraManager.cs


[SerializeField, Range(.5f, 3f)]
private float _speedMultiplier = 1f; //TODO: make this modifiable in the game settings
//this is the distance from player the camera will warp to when a new scene is loaded. this can be set individually on each scene, zero is the most consistent
[SerializeField,Tooltip("the distance from player the camera will warp to when a new scene is loaded")]
private float _SpawnDistanceFromPlayer = 0f;
[SerializeField] private TransformAnchor _cameraTransformAnchor = default;
[Header("Listening on channels")]

{
freeLookVCam.Follow = target;
freeLookVCam.LookAt = target;
freeLookVCam.OnTargetObjectWarped(target,target.position-freeLookVCam.transform.position);
//warp the camera to target without lerping to avoid long lerps
Vector3 positionDelta = (target.position-freeLookVCam.transform.position) - (target.position-freeLookVCam.transform.position).normalized*_SpawnDistanceFromPlayer;
freeLookVCam.OnTargetObjectWarped(target,positionDelta);
}
private void OnEnable()

private void OnFrameObjectEvent(Transform value)
{
Debug.Log("distance of player from camera:" + Vector3.Distance(freeLookVCam.transform.position,value.position));
SetupProtagonistVirtualCamera(value);
}
}
正在加载...
取消
保存