public ReasoningEvent LoadEvent(string key) { ReasoningEvent e = reasoningEvents[key]; currentEvent = e; return(currentEvent); }
public void SetReasoningEvent(ReasoningEvent rEvent) { reasoningEvent = rEvent; questionLabel.GetComponent <UILabel>().text = ""; if (reasoningEvent.choice.Count == 0 || reasoningEvent.choice == null) { EvidenceButtonInit(); ifevi = true; } else { ChoiceButtonInit(); ifevi = false; } }
public void Init(string eventName) { reasoningManager = ReasoningManager.GetInstance(); //获取uimanager uiManager = root.transform.Find("Avg_Panel/Reasoning_Panel").GetComponent <ReasoningUIManager>(); uiManager.transform.gameObject.SetActive(true); factory = NodeFactory.GetInstance(); uiManager.SetIsNew(isnew); uiManager.SetIsEnd(isend); reasoningEvent = reasoningManager.LoadEvent(eventName); uiManager.SetReasoningEvent(reasoningEvent); uiManager.SetReasoningNode(this); }
public static Dictionary <string, ReasoningEvent> GetStaticEnquireEvents() { Dictionary <string, ReasoningEvent> events = new Dictionary <string, ReasoningEvent>(); string path = Constants.DEBUG ? REASONING_DEBUG_PATH : REASONING_PATH; Debug.Log("读取自我推理表"); foreach (TextAsset text in Resources.LoadAll <TextAsset>(path)) { JsonData jsondata = JsonMapper.ToObject(text.text); foreach (JsonData jd in jsondata) { ReasoningEvent ee = new ReasoningEvent(jd); Debug.Log("读取:" + ee.id); events.Add(ee.id, ee); } } return(events); }
public ReasoningEvent LoadEvent(string key) { //if (!reasoningEvents.ContainsKey(key)) throw new Exception(); ReasoningEvent e = reasoningEvents[key]; //if (lVars.ContainsKey("自我推理编号")) //{ // if (e.id != (string)lVars["自我推理编号"]) // { // lVars["自我推理编号"] = e.id; // } //} //else //{ // lVars.Add("自我推理编号", e.id); //} currentEvent = e; return(currentEvent); }