Tanoda
MenuLoadSceneWebGL.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using GILES;
4using GILES.Interface;
5using UnityEngine;
6using UnityEngine.SceneManagement;
7
8public class MenuLoadSceneWebGL : MonoBehaviour
9{
11
12 public void OpenLoadPanel()
13 {
15 }
16
17 private void OnOpen(string path)
18 {
19 Open(path);
20 }
21#if UNITY_WEBGL || USENETWORK
22
23 public void Open(string path)
24 {
25#if USENETWORK
26 OpenCallback(NetworkManager.instance.GetDataFromCourseNameInCache(path.Remove(0, path.LastIndexOf('/') + 1)));
27#else
28 OpenCallback(NetworkManager.instance.GetDataFromCourseNameInCache(path.Replace("/", "")));
29#endif
30 }
31
32 public void OpenCallback(string json)
33 {
34 Debug.Log(json);
35 var go = new GameObject("loader_network");
36 var ssol = go.AddComponent<StartStageOnLoad>();
37 ssol.stageJson = json;
38
40
41 SceneManager.LoadScene(1);
42 }
43#else
44 public void Open(string path)
45 {
46 string san = pb_FileUtility.SanitizePath(path);
47
48 if(!pb_FileUtility.IsValidPath(san, ".json"))
49 {
50 Debug.LogWarning(san + " not found, or file is not a JSON scene.");
51 return;
52 }
53
54 string level = pb_FileUtility.ReadFile(san);
55
56 var go = new GameObject("loader");
57 var ssol = go.AddComponent<StartStageOnLoad>();
58 ssol.stageJson = level;
59
61
62 SceneManager.LoadScene(1);
63 }
64#endif
65}
UnityEngine.Debug Debug
Definition: TanodaServer.cs:19
void AddOnSaveListener(Callback< string > listener)
void Open(string path)
pb_FileDialog selectorWindow