public TsChapter tsInit(TsChapterDef def) { this.taskName = def.ToString(); for (int i=0; i<def.Steps.Length; i++){ addTask( Task.Create<TsStep>().tsInit(def.Steps[i])); } return this; }
public static TsChapterDef ReadChapter(string chapterName) { TsChapterDef def = new TsChapterDef(); XmlDocument doc = new XmlDocument(); doc.LoadXml((Resources.Load ("configData/TsChapter_" + chapterName) as TextAsset).text); def.FillWithXmlNode(doc.ChildNodes[1]); return def; }
public override void FillWithXmlNode(XmlNode node) { if (null == node){ Debug.LogError("node is null"); return; } string[] chapterNames = TsParmsTranslator.Translate(node.Attributes["chapters"].Value); chapters = new TsChapterDef[chapterNames.Length]; for (int i=0; i<chapterNames.Length; i++){ chapters[i] = new TsChapterDef(); chapters[i] = TsXmlReader.ReadChapter(chapterNames[i]); } }