Tanoda
FileMenu.cs
Go to the documentation of this file.
1using GILES;
2using System.Collections;
3using System.Collections.Generic;
4using UnityEngine;
5
6public class FileMenu : MonoBehaviour
7{
8 public GameObject edit, scene, tools, files, closeBackground, stage;
9 // Start is called before the first frame update
10 void Start()
11 {
12 HideAll();
13 }
14
15 public void FileHandleInput(int val)
16 {
17 if (val == 0)
18 {
19 GetComponent<pb_NewSceneButton>().OpenNewScene();
20 }
21 if (val == 1)
22 {
23 GetComponent<pb_LoadSceneButton>().OpenLoadPanel();
24 }
25 if (val == 2)
26 {
27 GetComponent<pb_SaveSceneButton>().OpenSavePanel();
28 }
29
30
31 }
32
33 public void EditHandleInput(int val)
34 {
35 if (val == 0)
36 {
37 GetComponent<pb_UndoButton>().DoUndo();
38 }
39 if (val == 1)
40 {
41 GetComponent<pb_RedoButton>().DoRedo();
42 }
43 if (val == 2)
44 {
45 GetComponent<pb_DeleteButton>().DoDelete();
46 }
47 if (val == 3)
48 {
49 FindObjectOfType<ReplayLogic>().ReplayLevel();
50 }
51 if (val == 4)
52 {
53
54 }
55 if (val == 5)
56 {
57 GetComponent<ToggleVR>().Toggle();
58 }
59
60
61
62 }
63 public void showHideEdit()
64 {
65 var active = !edit.activeInHierarchy;
66 HideAll();
67 closeBackground.SetActive(active);
68 edit.SetActive(active);
69 }
70 public void showHideScene()
71 {
72 var active = !scene.activeInHierarchy;
73 HideAll();
74 closeBackground.SetActive(active);
75 scene.SetActive(active);
76 }
77 public void showHideTools()
78 {
79 var active = !tools.activeInHierarchy;
80 HideAll();
81 closeBackground.SetActive(active);
82 tools.SetActive(active);
83 }
84
85 public void showHideFiles()
86 {
87 var active = !files.activeInHierarchy;
88 HideAll();
89 closeBackground.SetActive(active);
90 files.SetActive(active);
91 }
92 public void showHideStage()
93 {
94 var active = !stage.activeInHierarchy;
95 HideAll();
96 closeBackground.SetActive(active);
97 stage.SetActive(active);
98 }
99
100 public void HideAll()
101 {
102 edit.SetActive(false);
103 scene.SetActive(false);
104 tools.SetActive(false);
105 files.SetActive(false);
106 closeBackground.SetActive(false);
107 }
108}
GameObject files
Definition: FileMenu.cs:8
void showHideTools()
Definition: FileMenu.cs:77
void HideAll()
Definition: FileMenu.cs:100
void showHideFiles()
Definition: FileMenu.cs:85
void FileHandleInput(int val)
Definition: FileMenu.cs:15
GameObject scene
Definition: FileMenu.cs:8
GameObject stage
Definition: FileMenu.cs:8
GameObject edit
Definition: FileMenu.cs:8
void showHideEdit()
Definition: FileMenu.cs:63
void showHideStage()
Definition: FileMenu.cs:92
GameObject tools
Definition: FileMenu.cs:8
GameObject closeBackground
Definition: FileMenu.cs:8
void EditHandleInput(int val)
Definition: FileMenu.cs:33
void showHideScene()
Definition: FileMenu.cs:70