This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
project-undercover/Project Undercover/Assets/Scripts/UI/ButtonController.cs

38 lines
821 B
C#
Raw Permalink Normal View History

2017-11-27 20:27:19 -06:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ButtonController : MonoBehaviour {
2017-11-30 10:25:04 -06:00
2017-11-30 14:32:12 -06:00
public AudioClip button_sound;
public AudioSource button_sound_src;
public GameObject ui;
public void Start() {
button_sound_src = GetComponent<AudioSource>();
}
2017-11-30 10:25:04 -06:00
2017-11-27 20:27:19 -06:00
public void ExitGame() {
2017-11-30 14:32:12 -06:00
AudioManager.Main.PlayNewSound("button_sound");
2017-11-27 20:27:19 -06:00
Application.Quit();
}
2017-11-30 10:25:04 -06:00
2017-11-30 14:32:12 -06:00
public void NextScene(string name)
{
AudioManager.Main.PlayNewSound("button_sound");
Application.LoadLevel(name);
2017-11-27 20:27:19 -06:00
}
2017-11-30 10:25:04 -06:00
public void ShowInstructions() {
2017-11-30 14:32:12 -06:00
AudioManager.Main.PlayNewSound("button_sound");
ui.SetActive (true);
2017-11-30 10:25:04 -06:00
}
public void HideInstructions() {
2017-11-30 14:32:12 -06:00
AudioManager.Main.PlayNewSound("button_sound");
ui.SetActive (false);
2017-11-30 10:25:04 -06:00
}
2017-11-27 20:27:19 -06:00
}