This commit is contained in:
Gerard Gascón 2025-04-24 17:19:36 +02:00
commit 001bb14f16
951 changed files with 270074 additions and 0 deletions

View 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);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 04aae18cc1090b949a5749bd57c239fa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 86c935629cd5f0e418d0bf3f185a62d7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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();
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c0598d087e0fa4c4ba4eae71481cc83f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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();
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d7a6daf6a7f55ee48b7c33c93c39f86c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e518ab951c9300f489c6094e266786af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: