/// <summary> /// 读取label /// </summary> /// <param name="json">数据</param> private void ReadLabel(string json) { StoryLabelData data = JsonConvert.DeserializeObject <StoryLabelData> (json); Debug.Log(data.label); m_story.Add(data); }
public bool RequestLabel(string label) { foreach (StoryBasicData data in m_story) { if (data.typename == NodeType.label.ToString()) { StoryLabelData labelData = data as StoryLabelData; if (labelData.label == label) { return(true); } } } return(false); }
public bool JumpToWordAfterLabel(string label) { int i = -1; foreach (StoryBasicData item in m_story) { i++; if (item.typename != NodeType.label.ToString()) { continue; } StoryLabelData labelData = item as StoryLabelData; if (labelData.label != label) { continue; } if (i + 1 >= m_story.Count()) { m_index = m_story.Count(); return(false); } m_index = i + 1; return(true); //ignore all label and jump //for (int j = i + 1; j < m_story.Count (); j++) { // if (m_story [j].typename != NodeType.label.ToString ()) { // m_index = j; // return true; // } //} //else, story is end } return(false); }