Ejemplo n.º 1
0
 //Pausar o reanudar el juego
 public void Pause()
 {
     if (currentLevel != 0 && lifes > -1 && changingLevel == false && restarting == false && currentLevel != 4)
     {
         if (paused == false)
         {
             if (Time.timeScale != 0f)
             {
                 Time.timeScale = 0f;
                 pauseText.SetActive(true);
                 returnToMenuButton.SetActive(true);
                 GameObject              postProcessing = GameObject.Find("PostProcessing");
                 ColorAdjustments        ca             = (ColorAdjustments)postProcessing.GetComponent <Volume>().profile.components[1];
                 VolumeParameter <float> value          = new MinFloatParameter(-100f, 0, true);
                 ca.saturation.SetValue(value);
                 GameObject.Find("Player").GetComponent <PlayerControl>().controls.Disable();
                 paused = true;
             }
         }
         else
         {
             Time.timeScale = 1f;
             pauseText.SetActive(false);
             returnToMenuButton.SetActive(false);
             GameObject              postProcessing = GameObject.Find("PostProcessing");
             ColorAdjustments        ca             = (ColorAdjustments)postProcessing.GetComponent <Volume>().profile.components[1];
             VolumeParameter <float> value          = new MinFloatParameter(15, 0, true);
             ca.saturation.SetValue(value);
             GameObject.Find("Player").GetComponent <PlayerControl>().controls.Enable();
             paused = false;
         }
     }
 }
 private void Start()
 {
     postFxProfile.TryGet <DepthOfField>(out dof);
     dofDistanceParametar = dof.focusDistance;
     viewportCenter       = new Vector3(0.5f, 0.5f, 0);
     cameraMain           = GetComponent <Camera>();
 }
Ejemplo n.º 3
0
        public static void Convert(this BIRPRendering.FloatParameter birpSource, MinFloatParameter target, float scale = 1f, bool enabledState = true)
        {
            if (target == null)
            {
                return;
            }

            target.value         = enabledState ? birpSource.value * scale : 0f;
            target.overrideState = birpSource.overrideState;
        }
Ejemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     focDist       = dofComponent.focusDistance;
     focDist.value = focDistAnim;
 }