/// <summary> /// 创建xml /// </summary> /// <param name="type"></param> /// <param name="details"></param> private void creatXML(Type type, shootItem details) { path = Single <ToolHelp> .GetInstance.xmlPath( type.GetField("fileName").GetValue(null).ToString()); secondNodStr = type.GetField("fileName").GetValue(null).ToString().ToLower(); id = Single <ToolHelp> .GetInstance.dictionaryId(secondNodStr); if (secondNodStr == "answer" || secondNodStr == "dealwith_c") { id += int.Parse(Single <ToolHelp> .GetInstance.SceneNum) * 100000; } Single <XMLData> .GetInstance.CreatXML(path); //创建一个空的XML,有名字的 obj = Activator.CreateInstance(type); propertyInfos = type.GetProperties(); paramer[0] = details; for (int i = 0; i < propertyInfos.Count(); i++) { methodReturn = (string)type.InvokeMember(propertyInfos[i].Name + "1", BindingFlags.Default | BindingFlags.InvokeMethod, null, obj, paramer); //调用方法 Single <XMLData> .GetInstance.addXML(path, secondNodStr, id, propertyInfos[i].Name, methodReturn); //创建XML表 } }
public string pageIds1(shootItem t) { string[] pageIdContent = new string[Single <ToolHelp> .GetInstance.IdDictionary["当前应对界面页面数"]]; int pageId = Single <ToolHelp> .GetInstance.IdDictionary["dealwith_c"]; for (int i = Single <ToolHelp> .GetInstance.IdDictionary["当前应对界面页面数"] - 1; i >= 0; i--) { pageIdContent[i] = string.Format("{0}{1:d5}", Single <ToolHelp> .GetInstance.SceneNum, pageId); pageId--; if (pageId < 0) { break; } } string pageIDStr = null; for (int i = 0; i < pageIdContent.Length; i++) { if (i == 0) { pageIDStr = pageIdContent[i]; } else { pageIDStr += "," + pageIdContent[i]; } } return(pageIDStr); }
public string yes1(shootItem t) { int id = Single <ToolHelp> .GetInstance.IdDictionary["answer"]; id--; return(String.Format("{0}{1:d5}", Single <ToolHelp> .GetInstance.SceneNum, id)); }
public string ImgPaths1(shootItem t) { //return string.Format("Scene/{0}/{1}/IMG/DealWith/1", // Single<ToolHelp>.GetInstance.GetSceneName().Split('_')[0], // Single<ToolHelp>.GetInstance.GetSceneName()); return(string.Format("Scene/{0}/{1}/IMG/DealWith/1", Single <ToolHelp> .GetInstance.SceneClassName, Single <ToolHelp> .GetInstance.GetSceneName())); }
public string wendatishiMusic1(shootItem t) { //return string.Format("Scene/{0}/{1}/Music/answer/scenario_{2}/{3}", // Single<ToolHelp>.GetInstance.GetSceneName().Split('_')[0], // Single<ToolHelp>.GetInstance.GetSceneName(), // t[Single<ToolHelp>.GetInstance.IdDictionary["情景号"]].ToString().Split('景')[1], // t[Single<ToolHelp>.GetInstance.IdDictionary["镜头号"]]); return(string.Format("Scene/{0}/{1}/Music/answer/{2}/{3}", Single <ToolHelp> .GetInstance.SceneClassName, Single <ToolHelp> .GetInstance.GetSceneName(), t.scenesId, t.shootid)); }
public string xuanzetiXuanxiangPath1(shootItem t) { //return string.Format("Scene/{0}/{1}/Music/dialogue/scenario_{2}/XZ_{3}", // Single<ToolHelp>.GetInstance.GetSceneName().Split('_')[0], // Single<ToolHelp>.GetInstance.GetSceneName(), // t[Single<ToolHelp>.GetInstance.IdDictionary["情景号"]].ToString().Split('景')[1], // t[Single<ToolHelp>.GetInstance.IdDictionary["镜头号"]]); return(string.Format("Scene/{0}/{1}/Music/dialogue/{2}/xz_{3}", Single <ToolHelp> .GetInstance.SceneClassName, Single <ToolHelp> .GetInstance.GetSceneName(), t.scenesId, t.shootid)); }
public string YesOrNoID1(shootItem t) { if (boolCorrect()) { return("100011"); } else { return("100012"); } }
public string image1(shootItem t) { if (boolCorrect()) { return("yes"); } else { return("no"); } }
public string typePath1(shootItem t) { if (boolCorrect()) { return("Music/Teach/回答正确"); } else { return("Music/Teach/回答错误"); } }
public string type1(shootItem t) { if (boolCorrect()) { return("[00ff00]回答正确,你真棒![-]"); } else { return("[ff0000]很遗憾,回答错误![-]"); } }
public string contentPaths1(shootItem t) { //return string.Format("Scene/{0}/{1}/Music/answer/scenario_{2}/{3}", // Single<ToolHelp>.GetInstance.GetSceneName().Split('_').First(), // Single<ToolHelp>.GetInstance.GetSceneName(), // t[Single<ToolHelp>.GetInstance.IdDictionary["情景号"]].ToString().Split('景').LastOrDefault(), // t[Single<ToolHelp>.GetInstance.IdDictionary["镜头号"]]); return(string.Format("Scene/{0}/{1}/Music/answer/{2}/{3}", Single <ToolHelp> .GetInstance.SceneClassName, Single <ToolHelp> .GetInstance.GetSceneName(), t.scenesId, t.shootid)); }
public string image1(shootItem t) { if (Single <NPCName> .GetInstance.NpcNameDictionary. ContainsKey(Single <ToolHelp> .GetInstance.GetNPCName(t.word))) { return(Single <NPCName> .GetInstance.NpcNameDictionary [Single <ToolHelp> .GetInstance.GetNPCName(t.word)]); } else { return("moshengnanzi"); } }
public string contents1(shootItem t) { index = Single <ToolHelp> .GetInstance.dictionaryId("当前应对界面索引"); index--; string contents = t.TeachWord.ToString().Split('*')[index].ToString(); if (index == Single <ToolHelp> .GetInstance.IdDictionary["当前应对界面页面数"] - 1) { Single <ToolHelp> .GetInstance.IdDictionary["当前应对界面索引"] = 0; //使用完后把索引归零 } return(contents); }
/// <summary> 选择answer这个配制表ID在Question配制的位置 /// </summary> /// <param name="t"></param> /// <returns></returns> private int[] PdIdNumber(shootItem t) { int[] id = new int[2]; switch (t.Result) { case "正确": id[0] = Single <ToolHelp> .GetInstance.IdDictionary["answer"]; id[0]--; id[1] = Single <ToolHelp> .GetInstance.IdDictionary["answer"]; break; case "错误": id[1] = Single <ToolHelp> .GetInstance.IdDictionary["answer"]; id[1]--; id[0] = Single <ToolHelp> .GetInstance.IdDictionary["answer"]; break; } return(id); }
public string cameraState1(shootItem t) { //return Single<ToolHelp>.GetInstance.GetCameraNumber( // t[Single<ToolHelp>.GetInstance.IdDictionary["镜头号"]].ToString(), true); return(Single <ToolHelp> .GetInstance.GetCameraNumber(t.shootid, true)); }
public string wendatimu1(shootItem t) { return(Single <ToolHelp> .GetInstance.Getword(t.word)); }
public string wendaTishi1(shootItem t) { return(t.TeachWord); }
public string npcName1(shootItem t) { return(string.Format("{0}/Chat1", image1(t))); }
public string type1(shootItem t) { return("equipment"); }
public string name1(shootItem t) { return(Single <ToolHelp> .GetInstance.GetNPCName(t.word)); }
private PropertyInfo[] propertyInfos; //公共属性 /// <summary> /// 给内容分类,如选择、判断、对白等 /// </summary> /// <param name="shootItm"></param> public void selectDetails(shootItem shootItm) { switch (shootItm.type) { case "log": //对白 { creatXML(typeof(XMLDialog), shootItm); } break; case "pd": //判断 { creatXML(typeof(XMLAnswer), shootItm); creatXML(typeof(XMLAnswer), shootItm); creatXML(typeof(XMLQuestion), shootItm); } break; case "xz": //选择 { creatXML(typeof(XMLAnswer), shootItm); creatXML(typeof(XMLAnswer), shootItm); creatXML(typeof(XMLXuanZeTi), shootItm); } break; case "wd": //问答 { creatXML(typeof(XMLWenda), shootItm); } break; case "tw": //智者提问 { creatXML(typeof(XMLWiseManAsk), shootItm); } break; case "gc": //智者过场动画 { creatXML(typeof(XMLGuochangdonghua), shootItm); } break; case "kp": //科普 { creatXML(typeof(XMLkepu), shootItm); } break; case "wx": //应对界面 Single <ToolHelp> .GetInstance.IdDictionary["当前应对界面页面数"] = shootItm.TeachWord.Split('*').Length; for (int i = 0; i < Single <ToolHelp> .GetInstance.IdDictionary["当前应对界面页面数"]; i++) { creatXML(typeof(XMLDealWith_C), shootItm); } creatXML(typeof(XMLDealWith_T), shootItm); break; } }
public string details1(shootItem t) { //return t[Single<ToolHelp>.GetInstance.IdDictionary["判断题_系"]].ToString(); return(t.TeachWord); }
public string wendajingtou1(shootItem t) { return(Single <ToolHelp> .GetInstance.GetCameraNumber(t.shootid, true)); }
public string bTip1(shootItem t) { return("false"); }
//public string name1(shootItem t) //{ // return Single<ToolHelp>.GetInstance.GetNPCName(t[Single<ToolHelp>.GetInstance.IdDictionary["对白"]].ToString()); //} //public string image1(shootItem t) //{ // if (Single<NPCName>.GetInstance.NpcNameDictionary. // ContainsKey(Single<ToolHelp>.GetInstance.GetNPCName(t[Single<ToolHelp>.GetInstance.IdDictionary["对白"]].ToString()))) // { // return Single<NPCName>.GetInstance.NpcNameDictionary // [Single<ToolHelp>.GetInstance.GetNPCName(t[Single<ToolHelp>.GetInstance.IdDictionary["对白"]].ToString())]; // } // else // { // return "??"; // } //} //public string chatPoint1(shootItem t) //{ // return string.Format("{0}/Chat1", image1(t)); //} public string type1(shootItem t) { return("1"); }
public string nextShoot1(shootItem t) { return(Single <ToolHelp> .GetInstance.GetCameraNumber(t.shootid, true)); }
public string askdetails1(shootItem t) { return(Single <ToolHelp> .GetInstance.Getword(t.word)); }
public string name1(shootItem t) { return("老师"); }
public string answerdetails1(shootItem t) { return(t.TeachWord); }
public string cutCamera1(shootItem t) { return("CameraCube"); }