public static Recent Create(Recent prefab, Transform parent, string path, Action <Recent> clickAction, Action <Recent> closeAction) { var recent = Instantiate(prefab, parent); recent._nameText.text = System.IO.Path.GetFileNameWithoutExtension(path); recent._pathText.text = path; recent._clickAction = clickAction; recent._closeAction = closeAction; return(recent); }
private void RecentCloseButton_Clicked(Recent recent) { var recents = File.ReadAllLines(RecentsPath).ToList(); if (recents.Remove(recent.Path)) { Destroy(recent.gameObject); if (_content.childCount == 1) { _noRecents.SetActive(true); _recentsScrollView.SetActive(false); } File.WriteAllLines(RecentsPath, recents); } }
private void RecentButton_Clicked(Recent recent) => ApplicationFacade.Instance.LoadProject(recent.Path);