Esempio n. 1
0
 // Start is called before the first frame update
 void Start()
 {
     cam = gameObject.GetComponent <Camera>();
     if (cam == null)
     {
         Debug.Log("This script should be attatched to a Camera");
     }
     additionalCameraData = cam.transform.GetComponent <UnityEngine.Rendering.Universal.UniversalAdditionalCameraData>();
     additionalCameraData.SetRenderer(0);
 }
Esempio n. 2
0
 void Update()
 {
     if (debugModeisActive)
     {
         currentAnimationValue        += animationSpeed * Time.deltaTime;
         timeSinceDebugModeActivation += Time.deltaTime;
     }
     else
     {
         timeSinceDebugModeActivation = 0;
         currentAnimationValue       -= animationSpeed * Time.deltaTime;
         if (currentAnimationValue <= 0)
         {
             additionalCameraData.SetRenderer(0);
         }
     }
     currentAnimationValue = Mathf.Clamp(currentAnimationValue, 0, 1);
     foreach (Material m in animateMaterialsWhenToggelingDebugMode)
     {
         m.SetFloat("Vector1_BeginningAnimation", currentAnimationValue);
         m.SetFloat("Vector1_TimeSinceDebugModeActivation", timeSinceDebugModeActivation * debugClutterSpeedMultiplier);
     }
 }
 private void ChangeRenderView(int state)
 {
     UnityEngine.Rendering.Universal.UniversalAdditionalCameraData additionalCameraData = cam.transform.GetComponent <UnityEngine.Rendering.Universal.UniversalAdditionalCameraData>();
     additionalCameraData.SetRenderer(state);
 }