Tanoda
pb_OpenSceneButton.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3using System.Collections;
4#if !UNITY_5_2
5using UnityEngine.SceneManagement;
6#endif
7
8namespace GILES
9{
14 {
15 public string scene;
16
17 public override string tooltip { get { return Macro.T("BTN_EXIT"); } }
18
19 public void OpenScene()
20 {
21 try
22 {
23 GameObject.Find("EpilepsyFixer").SetActive(true);
24 }
25 catch (Exception)
26 {
27 // ignored
28 }
29#if !UNITY_WEBGL
30 Destroy(Valve.VR.InteractionSystem.Player.instance);
31 Destroy(FindObjectOfType<PreventDestroy>());
32#if !DANA
33 Destroy(GameObject.Find("CurrentUser"));
34 Destroy(GameObject.Find("SavedUser Singleton"));
35#endif
36 Destroy(GameObject.Find("NetworkManager"));
37 Destroy(GameObject.Find("[ChaperoneInfo]"));
38 Destroy(GameObject.Find("pb_AssetBundles Singleton"));
39#endif
40 Destroy(GameObject.Find("Player"));
41#if UNITY_5_2
42 Application.LoadLevel(scene);
43#else
44
45 HashingManager.instance.ClearHashTable();
46 SceneManager.LoadScene(scene);
47#endif
48 }
49 }
50}
Definition: Macro.cs:12
static string T(string key)
Definition: Macro.cs:19