浏览代码

Set Camera Noise

/feature-cinemachine-noise-shake
Thomas ICHÉ 4 年前
当前提交
11bb7518
共有 1 个文件被更改,包括 11 次插入4 次删除
  1. 15
      Runtime/LevelScripting/Actions/CinemachineSetCameraNoiseAction.cs

15
Runtime/LevelScripting/Actions/CinemachineSetCameraNoiseAction.cs


[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;
}
}
正在加载...
取消
保存