|
| 1 | +/* |
| 2 | + * Copyright (C) 2015, Philip Peng (Keripo). All rights reserved. |
| 3 | + * http://beats2.net |
| 4 | + * The software in this package is published under the terms of the BSD-style license |
| 5 | + * a copy of which has been included with this distribution in the LICENSE file. |
| 6 | + */ |
| 7 | +using System.Collections.Generic; |
| 8 | +using UnityEngine; |
| 9 | +using UnityEngine.UI; |
| 10 | +using System; |
| 11 | +using System.Reflection; |
| 12 | + |
| 13 | +namespace Beats2.Parser |
| 14 | +{ |
| 15 | + |
| 16 | + public class ParserTest : MonoBehaviour |
| 17 | + { |
| 18 | + private const string TAG = "ParserTest"; |
| 19 | + |
| 20 | + public string simfilePath; |
| 21 | + public Text contentText; |
| 22 | + |
| 23 | + public Text logHistoryText; |
| 24 | + public int logHistorySize; |
| 25 | + |
| 26 | + private ParserBase _parser; |
| 27 | + |
| 28 | + void Awake() |
| 29 | + { |
| 30 | + Logger.SetLogHistory(true); |
| 31 | + Logger.SetLogHistorySize(logHistorySize); |
| 32 | + } |
| 33 | + |
| 34 | + void Start() |
| 35 | + { |
| 36 | + _parser = ParserBase.GetParser(FileLoader.GetDataPath(simfilePath)); |
| 37 | + } |
| 38 | + |
| 39 | + void Update() |
| 40 | + { |
| 41 | + logHistoryText.text = Logger.GetLogHistoryString(); |
| 42 | + } |
| 43 | + |
| 44 | + public void LoadMetadata() |
| 45 | + { |
| 46 | + Logger.Debug(TAG, "LoadMetadata"); |
| 47 | + _parser.LoadMetadata(); |
| 48 | + contentText.text = Logger.DumpFields(_parser.simfile.metadata); |
| 49 | + } |
| 50 | + |
| 51 | + public void LoadLyrics() |
| 52 | + { |
| 53 | + Logger.Debug(TAG, "LoadLyrics"); |
| 54 | + _parser.LoadLyrics(); |
| 55 | + contentText.text = Logger.DumpFields(_parser.simfile.lyrics); |
| 56 | + } |
| 57 | + |
| 58 | + public void LoadCharts() |
| 59 | + { |
| 60 | + Logger.Debug(TAG, "LoadCharts"); |
| 61 | + _parser.LoadCharts(); |
| 62 | + contentText.text = Logger.DumpFields(_parser.simfile.charts); |
| 63 | + } |
| 64 | + } |
| 65 | +} |
| 66 | + |
0 commit comments