25 lines
683 B
C#
25 lines
683 B
C#
using UnityEngine;
|
|
|
|
public class DepthOfFieldController : MonoBehaviour
|
|
{
|
|
public bool IsFocusEnabled { get; private set; }
|
|
public Transform FocusTarget { get; private set; }
|
|
|
|
public void EnableFocus(Transform focusTarget)
|
|
{
|
|
IsFocusEnabled = true;
|
|
FocusTarget = focusTarget;
|
|
|
|
// In a project with Post Processing or URP Volume, enable Depth of Field here
|
|
// and update focus distance from the active camera to FocusTarget.
|
|
}
|
|
|
|
public void DisableFocus()
|
|
{
|
|
IsFocusEnabled = false;
|
|
FocusTarget = null;
|
|
|
|
// Disable the real Depth of Field override here when a post-processing stack is connected.
|
|
}
|
|
}
|