If you want to disable the Unit UI while the action camera is active you can also do something like this:
[SerializeField] GameObject actionCameraGameObject;
[SerializeField] LayerMask normalCameraCullingMask;
[SerializeField] LayerMask actionCameraCullingMask;
void Start() {
BaseAction.OnAnyActionStarted += OnAnyActionStarted;
BaseAction.OnAnyActionCompleted += OnAnyActionCompleted;
HideActionCamera();
}
void ShowActionCamera() {
Camera.main.cullingMask = actionCameraCullingMask;
actionCameraGameObject.SetActive(true);
}
void HideActionCamera() {
Camera.main.cullingMask = normalCameraCullingMask;
actionCameraGameObject.SetActive(false);
}
Then set the normal camera mask to âeverythingâ and disable the âuiâ layer on the action camera mask.