public void ReadFile(string filePath) { string rsult = string.Empty; AdvManager.Instance.useDebugMsg = true; try { var sr = new StreamReader(File.Open(filePath, FileMode.Open)); rsult = sr.ReadToEnd(); sr.Dispose(); } catch (Exception e) { AdvUtility.Log("CSV 無法讀取, 確認是否有其他程式使用該檔案中 (" + e.Message + ")"); return; } if (workFlowchart != null) { Destroy(workFlowchart.gameObject); } GameObject copyFlowchart = Instantiate(flowchartPrefab); workFlowchart = copyFlowchart.GetComponent <FlowchartExtend>(); //workFlowchart = flowchartPrefab.GetComponent<Flowchart>(); firstCall = workFlowchart.GetComponent <CallExtend>(); //1. 開始 ADV系統 //2. 清除舊的除錯訊息 AdvManager.Instance.StartAdvScene(); AdvDebugMsg.ClearMessage(); AdvDebugMessageBox.ClearMessage(); //顯示讀取結果面板 ResultPanel.gameObject.SetActive(true); //開始讀取 AdvUtility.CreateBlockByCSV(workFlowchart, rsult, false); }
public static void LogBox(string msg) { AdvDebugMessageBox.AddMessage(msg); }
private void Awake() { instance = this; }