Ejemplo n.º 1
0
            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);
            }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 private void RecentButton_Clicked(Recent recent) => ApplicationFacade.Instance.LoadProject(recent.Path);