Files
PIM_8/Assets/_Scripts/DepthOfFieldController.cs
T

25 lines
683 B
C#
Raw Normal View History

2026-06-04 15:45:39 +03:00
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.
}
}