using System.Collections; using System.Collections.Generic; using UnityEngine; public class PauseButton : MonoBehaviour { public bool Pause; [SerializeField] private GameSpeed gamespeed; public void ButtonPause() { this.Pause = true; if (this.Pause == true) { Time.timeScale = 0f; } } public void ButtonPlay() { this.Pause = false; if (this.Pause == false) { if (gamespeed.isFastSpeed == true) { Time.timeScale = 2f; } else { Time.timeScale = 1f; } } } }