init
This commit is contained in:
commit
001bb14f16
951 changed files with 270074 additions and 0 deletions
21
Assets/Scripts/Menu/BackButton.cs
Normal file
21
Assets/Scripts/Menu/BackButton.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class BackButton : MonoBehaviour{
|
||||
|
||||
public GameObject activate;
|
||||
public GameObject desactivate;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetButtonDown("Cancel")){
|
||||
if (desactivate.activeSelf){
|
||||
AudioManager.instance.Play("Back");
|
||||
}
|
||||
activate.SetActive(true);
|
||||
desactivate.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Menu/BackButton.cs.meta
Normal file
11
Assets/Scripts/Menu/BackButton.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 04aae18cc1090b949a5749bd57c239fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
26
Assets/Scripts/Menu/Creditos.cs
Normal file
26
Assets/Scripts/Menu/Creditos.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Video;
|
||||
|
||||
public class Creditos : MonoBehaviour{
|
||||
|
||||
public float time;
|
||||
public LevelLoader levelLoader;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
Invoke("Video", time);
|
||||
AudioManager.instance.Stop("Menu");
|
||||
}
|
||||
|
||||
void Update(){
|
||||
if (Input.GetButtonDown("Cancel")){
|
||||
Video();
|
||||
}
|
||||
}
|
||||
|
||||
void Video(){
|
||||
levelLoader.LoadLevel(0);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Menu/Creditos.cs.meta
Normal file
11
Assets/Scripts/Menu/Creditos.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 86c935629cd5f0e418d0bf3f185a62d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
30
Assets/Scripts/Menu/Menu.cs
Normal file
30
Assets/Scripts/Menu/Menu.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class Menu : MonoBehaviour{
|
||||
|
||||
public AudioMixer secondaryChannel;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
AudioManager.instance.Play("Menu");
|
||||
AudioManager.instance.Stop("Theme");
|
||||
AudioManager.instance.Stop("Theme2");
|
||||
AudioManager.instance.Stop("Vela");
|
||||
secondaryChannel.SetFloat("secondaryVolume", -80);
|
||||
PlayerPrefs.DeleteKey("Casa");
|
||||
PlayerPrefs.DeleteKey("CheckPoint");
|
||||
Time.timeScale = 1;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
|
||||
public void Quit(){
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Menu/Menu.cs.meta
Normal file
11
Assets/Scripts/Menu/Menu.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c0598d087e0fa4c4ba4eae71481cc83f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
45
Assets/Scripts/Menu/PauseMenu.cs
Normal file
45
Assets/Scripts/Menu/PauseMenu.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PauseMenu : MonoBehaviour{
|
||||
|
||||
public GameObject pauseMenu;
|
||||
|
||||
bool gameIsPaused;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Escape)){
|
||||
if (gameIsPaused){
|
||||
Time.timeScale = 1;
|
||||
pauseMenu.SetActive(false);
|
||||
gameIsPaused = false;
|
||||
}else{
|
||||
Time.timeScale = 0;
|
||||
pauseMenu.SetActive(true);
|
||||
gameIsPaused = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Continuar(){
|
||||
Time.timeScale = 1;
|
||||
pauseMenu.SetActive(false);
|
||||
gameIsPaused = false;
|
||||
}
|
||||
|
||||
public void Menu(){
|
||||
Time.timeScale = 1;
|
||||
gameIsPaused = false;
|
||||
}
|
||||
|
||||
public void Quit(){
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Menu/PauseMenu.cs.meta
Normal file
11
Assets/Scripts/Menu/PauseMenu.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d7a6daf6a7f55ee48b7c33c93c39f86c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
49
Assets/Scripts/Menu/SettingsMenu.cs
Normal file
49
Assets/Scripts/Menu/SettingsMenu.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SettingsMenu : MonoBehaviour{
|
||||
|
||||
public AudioMixer audioMixer;
|
||||
|
||||
public Dropdown resolutionDropdown;
|
||||
|
||||
Resolution[] resolutions;
|
||||
|
||||
void Start(){
|
||||
audioMixer.SetFloat("volume", 0);
|
||||
resolutions = Screen.resolutions;
|
||||
|
||||
List<string> options = new List<string>();
|
||||
|
||||
int currentResolutionIndex = 0;
|
||||
for (int i = 0; i < resolutions.Length; i++){
|
||||
string option = resolutions[i].width + "x" + resolutions[i].height;
|
||||
options.Add(option);
|
||||
|
||||
if (resolutions[i].width == Screen.currentResolution.width &&
|
||||
resolutions[i].height == Screen.currentResolution.height){
|
||||
currentResolutionIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
resolutionDropdown.AddOptions(options);
|
||||
resolutionDropdown.value = currentResolutionIndex;
|
||||
resolutionDropdown.RefreshShownValue();
|
||||
}
|
||||
|
||||
public void SetResolution(int resolutionIndex){
|
||||
Resolution resolution = resolutions[resolutionIndex];
|
||||
Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
|
||||
}
|
||||
|
||||
public void SetQuality(int qualityIndex){
|
||||
QualitySettings.SetQualityLevel(qualityIndex);
|
||||
}
|
||||
|
||||
public void SetFullscreen(bool isFullScreen){
|
||||
Screen.fullScreen = isFullScreen;
|
||||
}
|
||||
}
|
11
Assets/Scripts/Menu/SettingsMenu.cs.meta
Normal file
11
Assets/Scripts/Menu/SettingsMenu.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e518ab951c9300f489c6094e266786af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue