30 lines
658 B
C#
30 lines
658 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PauseMenu : MonoBehaviour
|
|
{
|
|
|
|
public GameObject pauseMenu;
|
|
public AudioSource BG_Music;
|
|
public BackgroundScroller bgscript;
|
|
|
|
public LogicScript logic;
|
|
|
|
|
|
void Start()
|
|
{
|
|
bgscript = GameObject.FindGameObjectWithTag("Background").GetComponent<BackgroundScroller>();
|
|
logic = GetComponent<LogicScript>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Escape)&&!logic.IsFreezed) {
|
|
pauseMenu.SetActive(true);
|
|
BG_Music.Stop();
|
|
bgscript.ScrollSpeed = 0f;
|
|
}
|
|
}
|
|
}
|