diff options
Diffstat (limited to 'WorldlineKeepers/Assets/Tools/LevelEditor/TestLevel.cs')
-rw-r--r-- | WorldlineKeepers/Assets/Tools/LevelEditor/TestLevel.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/WorldlineKeepers/Assets/Tools/LevelEditor/TestLevel.cs b/WorldlineKeepers/Assets/Tools/LevelEditor/TestLevel.cs new file mode 100644 index 0000000..fd93704 --- /dev/null +++ b/WorldlineKeepers/Assets/Tools/LevelEditor/TestLevel.cs @@ -0,0 +1,34 @@ +using LitJson; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.IO; +using UnityEngine; +using UnityEngine.UI; +using WK.Data; + +public class TestLevel : MonoBehaviour +{ + public InputField m_StageFile; + public UnityEngine.UI.Button m_BtnStage; + + public Transform m_RootStage; + + private void Awake() + { + DataManager.Instance.AsyncLoadAll(); + + m_StageFile.text = "Assets/Bundle/stages/stage0/stage.json"; + + m_BtnStage.onClick.AddListener(OnClickStage); + + } + + void OnClickStage() + { + string file = m_StageFile.text; + string content = File.ReadAllText(file); + StageMetadata metadata = JsonMapper.ToObject<StageMetadata>(content); + StageBuilder.Instance.AsyncBuildStage(metadata, m_RootStage); + } +} |