Add files via upload

Some first day fug fixes.
This commit is contained in:
Geri 2021-01-09 01:57:59 +01:00 committed by GitHub
parent 7046716893
commit a29bc6aba4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 123 additions and 10 deletions

View file

@ -20,9 +20,14 @@ public static class ScreenShake{
}
}
/// <summary>Shake the camera
/// <para>It needs a cinemachine camera with a noise profile in it.</para>
/// </summary>
public static void Shake(float intensity, float time){
if(vCam == null || shakeUpdate == null){
if(vCam == null){
vCam = Camera.main.GetComponent<CinemachineBrain>().ActiveVirtualCamera.VirtualCameraGameObject.GetComponent<CinemachineVirtualCamera>();
}
if(shakeUpdate == null){
shakeUpdate = new GameObject("ShakeUpdate").AddComponent<ScreenShakeUpdate>();
}
shakeUpdate.startingIntensity = intensity;