Archival Commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class EndSceneSystem : MonoBehaviour
|
||||
{
|
||||
|
||||
private AudioSource AS;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
AS = GetComponent<AudioSource>();
|
||||
|
||||
AS.volume = DataSave.musicVol;
|
||||
AS.Play();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void BackToMenuButton()
|
||||
{
|
||||
SceneManager.LoadScene(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 639b09f13bc4b0c418da3d6f16f7c97b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class MenuSystem : MonoBehaviour
|
||||
{
|
||||
|
||||
public GameObject sceneChanger;
|
||||
|
||||
public Slider musicSlider;
|
||||
public Slider soundSlider;
|
||||
|
||||
|
||||
private AudioSource AS;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
AS = GetComponent<AudioSource>();
|
||||
|
||||
AS.volume = DataSave.musicVol;
|
||||
AS.Play();
|
||||
}
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void PlayButton()
|
||||
{
|
||||
sceneChanger.SetActive(true);
|
||||
sceneChanger.GetComponent<Animator>().SetTrigger("PlayGame");
|
||||
|
||||
|
||||
StartCoroutine(WaitPlay());
|
||||
}
|
||||
|
||||
|
||||
public void ExitButton()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void ChangeVol()
|
||||
{
|
||||
DataSave.soundVol = soundSlider.value;
|
||||
DataSave.musicVol = musicSlider.value;
|
||||
|
||||
AS.volume = DataSave.musicVol;
|
||||
}
|
||||
|
||||
|
||||
IEnumerator WaitPlay()
|
||||
{
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
SceneManager.LoadScene(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public enum VolType
|
||||
{
|
||||
music = 0, sound = 1
|
||||
}
|
||||
|
||||
|
||||
public static class DataSave
|
||||
{
|
||||
public static float musicVol = 75;
|
||||
public static float soundVol = 75;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e74376d3c33fb8747bf010a8730f1df8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MusicEmiter : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
|
||||
private AudioSource AS;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
AS = GetComponent<AudioSource>();
|
||||
|
||||
AS.volume = DataSave.musicVol;
|
||||
|
||||
AS.Play();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 387123af3753e1847b9b07a4f4abe2b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user