Example #1
0
    /// <summary>
    /// Switcher of windows
    /// </summary>
    /// <param name="type"></param>
    private void showWindow(ShowWindowType type)
    {
        Debug.Log("type " + type);
        int newScore = -1;

        switch (showWindowType)
        {
        case ShowWindowType.Game:
            gameWindow.SetActive(false);
            gameUiWindow.SetActive(false);
            break;

        case ShowWindowType.Menu:
            menuWindow.SetActive(false);
            _particleSystem.Stop();
            _particleSystem.gameObject.SetActive(false);
            break;

        case ShowWindowType.ChoiceLevel:
            choiceLevelWindow.SetActive(false);
            break;

        case ShowWindowType.Settings:
            settingsUiWindow.SetActive(false);
            break;
        }
        switch (type)
        {
        case ShowWindowType.ChoiceLevel:
            choiceLevelWindow.SetActive(true);
            break;

        case ShowWindowType.Game:
            gameWindow.SetActive(true);
            gameUiWindow.SetActive(true);
            GameBoard.StartNewGame();
            MusicManager.TransitionToGame();
            break;

        case ShowWindowType.Menu:
            _particleSystem.gameObject.SetActive(true);
            _particleSystem.Play();
            MusicManager.TransitionToMenu();
            menuWindow.SetActive(true);
            break;

        case ShowWindowType.Settings:
            GameBoard.isPause = true;
            settingsUiWindow.SetActive(true);
            gameUiWindow.SetActive(false);
            gameWindow.SetActive(false);
            break;
        }
        showWindowType = type;
    }
Example #2
0
 public static extern bool ShowWindow(IntPtr hWnd, ShowWindowType nCmdShow);
Example #3
0
        public static void StartProgramAdmin(string program, string args, MethodInvoker successAction, ShowWindowType showType, IntPtr hWnd)
        {
            ShellExecuteInfo info = new ShellExecuteInfo
            {
                cbSize = ShellExecuteInfo.SizeOf,
                lpFile = program,
                nShow = showType,
                lpVerb = "runas",
                lpParameters = args,
                hWnd = hWnd
            };

            if (Win32.ShellExecuteEx(ref info))
            {
                if (successAction != null)
                    successAction();
            }
        }
Example #4
0
        public static void StartProgramAdmin(string program, string args,
            MethodInvoker successAction, ShowWindowType showType, IntPtr hWnd)
        {
            var info = new ShellExecuteInfo();

            info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
            info.lpFile = program;
            info.nShow = showType;
            info.lpVerb = "runas";
            info.lpParameters = args;
            info.hWnd = hWnd;

            if (Win32.ShellExecuteEx(ref info))
            {
                if (successAction != null)
                    successAction();
            }
        }
Example #5
0
 public bool Show(ShowWindowType flags)
 {
     return(Win32.ShowWindow(this, flags));
 }
Example #6
0
 public static extern bool ShowWindowAsync(IntPtr hWnd, ShowWindowType type);