public void OnClickDeleteAll() { Debug.Log("clear all (mouse)"); AppMgr.Mode = MENU.DELETE_ALL; ClickOnPanel.DeleteAll(); AppMgr.Mode = 0; AppMgr.ModeStep = 0; AppMgr.MenuOn = false; DestroyMenuOnUI(); CreateMenuOffUI(); AppMgr.DrawOn = true; }
public void OnClickOpen() { Debug.Log("open (mouse)"); AppMgr.Mode = MENU.DELETE_ALL; ClickOnPanel.DeleteAll(); AppMgr.Mode = MENU.OPEN; AppMgr.FileDialogOn = true; //モードを非描画モードにする。 AppMgr.DrawOn = false; DestroyMenuOnUI(); CreateMenuOffUI(); Util.OpenLogSelectFile(); //SceneManager.LoadScene("OpenDialog"); AppMgr.Mode = 0; AppMgr.ModeStep = 0; AppMgr.MenuOn = false; //AppMgr.DrawOn = true; }
private static void LoadFileUsingPath(string path) { ClickOnPanel.DeleteAll(); if (path != null && path.Length != 0) { try { using (StreamReader reader = new StreamReader(path, false)) { InitLog(); string str; int PId = -1, LId = -1, CId = -1, MId = -1; do { str = reader.ReadLine(); if (str == null) { break; //多分要らない。 } else { Log lg = GetLogFromString(str); //AddLog(lg); if (lg.ObjectType == "Point") { if (PId < lg.Id) { PId = lg.Id; } } else if (lg.ObjectType == "Line") { if (LId < lg.Id) { LId = lg.Id; } } else if (lg.ObjectType == "Circle") { if (CId < lg.Id) { CId = lg.Id; } } else if (lg.ObjectType == "Module") { if (MId < lg.Id) { MId = lg.Id; } } } }while (str != null); reader.Close(); ClickOnPanel.SetId(PId + 1, LId + 1, CId + 1, MId + 1); AppMgr.pts = MonoBehaviour.FindObjectsOfType <Point>(); AppMgr.lns = MonoBehaviour.FindObjectsOfType <Line>(); AppMgr.cis = MonoBehaviour.FindObjectsOfType <Circle>(); AppMgr.mds = MonoBehaviour.FindObjectsOfType <Module>(); } } catch (Exception e) { Debug.Log(e.Message); } } else { Debug.Log("Invalid path given"); } AppMgr.DrawOn = true; AppMgr.KeyOn = true; AppMgr.FileDialogOn = false; }