| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, May 03, 2018 |
| | | // [ Date ]: Tuesday, February 12, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public partial class NPCDialogueConfig : ConfigBase { |
| | | |
| | | public int ID { get ; private set ; } |
| | | public int NPCID { get ; private set ; } |
| | | public int DataMapId { get ; private set ; } |
| | | public int Interval { get ; private set ; } |
| | | public int NextTime { get ; private set ; } |
| | | public int ID; |
| | | public int NPCID; |
| | | public int DataMapId; |
| | | public int Interval; |
| | | public int NextTime; |
| | | public string[] Dialogues; |
| | | |
| | | public override string getKey() |
| | |
| | | return ID.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | public override void Parse(string content) { |
| | | try |
| | | { |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | var contents = content.Split('\t'); |
| | | |
| | | int.TryParse(contents[0],out ID); |
| | | |
| | | NPCID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | int.TryParse(contents[1],out NPCID); |
| | | |
| | | DataMapId=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | int.TryParse(contents[2],out DataMapId); |
| | | |
| | | Interval=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | int.TryParse(contents[3],out Interval); |
| | | |
| | | NextTime=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | int.TryParse(contents[4],out NextTime); |
| | | |
| | | Dialogues = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Dialogues = contents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | } |
| | | catch (Exception ex) |
| | | { |