|
|
|
|
|
|
[SerializeField] |
|
|
|
bool useLiveCamera; |
|
|
|
[SerializeField, HideIf("useLiveCamera")] |
|
|
|
CinemachineVirtualCameraBase targetCamera; |
|
|
|
CinemachineVirtualCamera targetCamera; |
|
|
|
|
|
|
|
NoiseSettings settings; |
|
|
|
CinemachineVirtualCameraBase cam = useLiveCamera ? |
|
|
|
Manager.Get<VirtualCameraManager>().GetComponent<CinemachineBrain>().ActiveVirtualCamera as CinemachineVirtualCameraBase |
|
|
|
CinemachineVirtualCamera cam = useLiveCamera ? |
|
|
|
Manager.Get<VirtualCameraManager>().GetComponent<CinemachineBrain>().ActiveVirtualCamera as CinemachineVirtualCamera |
|
|
|
Debug.Log("CinemachineSetCameraNoiseAction : Cannot find a suitable Camera to set noise"); |
|
|
|
Debug.Log("CinemachineSetCameraNoiseAction : Cannot find a suitable CinemachineVirtualCamera to set Noise to"); |
|
|
|
var noise = cam.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>(); |
|
|
|
if(noise == null && settings != null) |
|
|
|
cam.AddCinemachineComponent<CinemachineBasicMultiChannelPerlin>(); |
|
|
|
|
|
|
|
noise.m_NoiseProfile = settings; |
|
|
|
} |
|
|
|
} |
|
|
|
|