Need to make ma camera component working unscaled time while every thing is on time.timescale = 0
Please help, tried many thing
1st script is on Pause menu. 2nd on camera.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using VideoGlitches;
public class PauseMenu : MonoBehaviour {
public static bool GameIsPaused = false;
public GameObject pauseMenuUI;
public VHS_Pause other;
void Start()
{
}
void Update () {
if (Input.GetKeyDown (KeyCode.Escape))
{
if (GameIsPaused) {
Resume ();
} else
{
Pause ();
}
}
}
public void Resume()
{
other.TurnOff ();
pauseMenuUI.SetActive (false);
Time.timeScale = 1f;
GameIsPaused = false;
}
void Pause()
{
other.TurnOn ();
pauseMenuUI.SetActive (true);
Time.timeScale = 0f;
GameIsPaused = true;
}
public void LoadMenu()
{
Time.timeScale = 1f;
SceneManager.LoadScene ("MainMenu");
}
}
Second script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VideoGlitches;
public class VHS_Pause : MonoBehaviour {
private VideoGlitchVHSPause vhsCamPause;
void Start () {
vhsCamPause = GetComponent<VideoGlitchVHSPause> ();
}
public void TurnOn()
{
vhsCamPause.enabled = true;
}
public void TurnOff()
{
vhsCamPause.enabled = false;
}
}