mirror of
https://github.com/celisej567/forest.git
synced 2026-09-21 20:15:21 +03:00
Initial commit
This commit is contained in:
83
Assets/scripts/menu/GraphicSlider.cs
Normal file
83
Assets/scripts/menu/GraphicSlider.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
|
||||
public class GraphicSlider : MonoBehaviour
|
||||
{
|
||||
int GLevel = 2;
|
||||
|
||||
public Text Handle;
|
||||
|
||||
public RenderPipelineAsset[] DetailLevel;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (PlayerPrefs.HasKey("GraphicsLevel"))
|
||||
{
|
||||
GLevel = PlayerPrefs.GetInt("GraphicsLevel");
|
||||
GetComponent<Slider>().value = GLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerPrefs.SetInt("GraphicsLevel", 2);
|
||||
|
||||
}
|
||||
|
||||
GetComponent<Slider>().value = GLevel;
|
||||
|
||||
switch (GLevel)
|
||||
{
|
||||
case 0:
|
||||
Handle.text = "low";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Handle.text = "medium";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Handle.text = "high";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Changed()
|
||||
{
|
||||
GLevel = ((int)GetComponent<Slider>().value);
|
||||
QualitySettings.SetQualityLevel(GLevel);
|
||||
QualitySettings.renderPipeline = DetailLevel[GLevel];
|
||||
Debug.Log(QualitySettings.renderPipeline.name);
|
||||
|
||||
PlayerPrefs.SetInt("GraphicsLevel", GLevel);
|
||||
PlayerPrefs.Save();
|
||||
|
||||
switch (GLevel)
|
||||
{
|
||||
case 0:
|
||||
Handle.text = "low";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Handle.text = "medium";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Handle.text = "high";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/scripts/menu/GraphicSlider.cs.meta
Normal file
11
Assets/scripts/menu/GraphicSlider.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c67f4094043b9cc42bd43000505af2b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12
Assets/scripts/menu/exit.cs
Normal file
12
Assets/scripts/menu/exit.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class exit : MonoBehaviour
|
||||
{
|
||||
public void Exit()
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/exit.cs.meta
Normal file
11
Assets/scripts/menu/exit.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53e6dc6fc43d5ce4e8f3cf98ea7b113b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/scripts/menu/leave.cs
Normal file
13
Assets/scripts/menu/leave.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class leave : MonoBehaviour
|
||||
{
|
||||
public string MenuName;
|
||||
public void <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>()
|
||||
{
|
||||
SceneManager.LoadScene(MenuName);
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/leave.cs.meta
Normal file
11
Assets/scripts/menu/leave.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fab3506914a16d4419984a1de5cdaa7f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/scripts/menu/play.cs
Normal file
18
Assets/scripts/menu/play.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class play : MonoBehaviour
|
||||
{
|
||||
|
||||
public void Load()
|
||||
{
|
||||
StartCoroutine("load");
|
||||
}
|
||||
|
||||
IEnumerable load()
|
||||
{
|
||||
SceneManager.LoadScene("game");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/play.cs.meta
Normal file
11
Assets/scripts/menu/play.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7129716d8ae09b4f918b647434e318c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/scripts/menu/settingsbutton.cs
Normal file
21
Assets/scripts/menu/settingsbutton.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class settingsbutton : MonoBehaviour
|
||||
{
|
||||
|
||||
public void Load()
|
||||
{
|
||||
|
||||
Time.timeScale = 1;
|
||||
StartCoroutine("load");
|
||||
}
|
||||
|
||||
IEnumerable load()
|
||||
{
|
||||
SceneManager.LoadSceneAsync("settings");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/settingsbutton.cs.meta
Normal file
11
Assets/scripts/menu/settingsbutton.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6b33bc3874b38d408eee8287063a7f0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user