Beispiel #1
0
        public bool isPlayerOnTopMostWindow()
        {
            FolderWindow win = windowStack.Peek() as FolderWindow;

            if (win == null)
            {
                return(false);
            }
            return(win.gridRect.Contains(Player.I.GridPos));
        }
Beispiel #2
0
        public void OpenWindow(GridIcon icon)
        {
            GameObject go = null;

            if (icon.isFolder)
            {
                go = Instantiate(availableFolderWindows[Random.Range(0, availableFolderWindows.Length)].gameObject, frontWindows);
                FolderWindow foldWin = go.GetComponent <FolderWindow>();
                windowStack.Push(foldWin);
            }
            else
            {
                ImageWindow imgWin = null;
                switch (icon.ext)
                {
                case "png":
                case "jpg":
                case "bmp":
                    go = Instantiate(imgWindow.gameObject, frontWindows);
                    break;

                case "html":
                    go = Instantiate(webWindow.gameObject, frontWindows);
                    break;

                case "txt":
                    go = Instantiate(textWindow.gameObject, frontWindows);
                    break;

                case "pdf":
                    go = Instantiate(pdfWindow.gameObject, frontWindows);
                    break;
                }
                imgWin = go?.GetComponent <ImageWindow>();
                windowStack.Push(imgWin);
            }
        }