mirror of
https://github.com/celisej567/forest.git
synced 2026-09-21 20:15:21 +03:00
1
This commit is contained in:
@@ -15,8 +15,6 @@ public class CameraMovement : MonoBehaviour
|
||||
void Start()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
@@ -35,6 +33,14 @@ public class CameraMovement : MonoBehaviour
|
||||
{
|
||||
if (Input.GetKeyUp(KeyCode.Escape))
|
||||
{
|
||||
GameRules gr = GameObject.FindObjectOfType<GameRules>();
|
||||
|
||||
if(gr.LoseStarted)
|
||||
{
|
||||
StartCoroutine("Restart");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pause)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Confined;
|
||||
@@ -50,19 +56,26 @@ public class CameraMovement : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable PauseGame()
|
||||
IEnumerator PauseGame()
|
||||
{
|
||||
SceneManager.LoadSceneAsync("pause", LoadSceneMode.Additive);
|
||||
Time.timeScale = 0;
|
||||
return null;
|
||||
}
|
||||
|
||||
IEnumerable UnPauseGame()
|
||||
IEnumerator UnPauseGame()
|
||||
{
|
||||
SceneManager.UnloadSceneAsync("pause");
|
||||
Time.timeScale = 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
IEnumerator Restart()
|
||||
{
|
||||
SceneManager.UnloadSceneAsync("game");
|
||||
SceneManager.LoadSceneAsync("game");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
12
Assets/scripts/general/player/SpawnFuncs.cs
Normal file
12
Assets/scripts/general/player/SpawnFuncs.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SpawnFuncs : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
QualitySettings.SetQualityLevel(PlayerPrefs.GetInt("GraphicsLevel"));
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/general/player/SpawnFuncs.cs.meta
Normal file
11
Assets/scripts/general/player/SpawnFuncs.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23b33987753308746b94905426f532e1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user