-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonFunctions.cs
More file actions
38 lines (34 loc) · 889 Bytes
/
ButtonFunctions.cs
File metadata and controls
38 lines (34 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using UnityEngine;
using UnityEngine.SceneManagement;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class ButtonFunctions : MonoBehaviour
{
public GameObject AboutText;
public void StartTour()
{
// Load the scene with the name "1_WC_to_Palms"
SceneManager.LoadScene("1_WC_to_Palms");
}
public void About()
{
// Toggle the visibility of the AboutText GameObject
if (AboutText != null)
{
AboutText.SetActive(!AboutText.activeSelf);
}
}
public void Exit()
{
// Logs the quit request in the Unity Editor console
Debug.Log("Quit requested");
#if UNITY_EDITOR
// Stop playing the scene in the Unity Editor
EditorApplication.isPlaying = false;
#else
// Quit the application
Application.Quit();
#endif
}
}