示例#1
0
    public void OpenMenu(string menuKey)
    {
        GameObject menu = null;

        if (_menuDictionary.TryGetValue(menuKey.ToLower(), out menu))
        {
            if (_openMenu.Menu != null)
            {
                _openMenu.Menu.SetActive(false);
            }
            _openMenu = new MenuPair(menuKey, menu);
            menu.SetActive(true);

            switch (menuKey.ToLower())
            {
            case "deathmatch":
                PlayerPrefs.SetInt("GameMode", (int)GameManager.GameModeChoice.DeathMatch);
                break;

            case "lastmanstanding":
                PlayerPrefs.SetInt("GameMode", (int)GameManager.GameModeChoice.LastManStanding);
                break;

            default:
                break;
            }

            Debug.Log(PlayerPrefs.GetInt("GameMode"));
        }
    }
示例#2
0
    public void OpenMenu(string menuKey)
    {
        GameObject menu = null;
        if (_menuDictionary.TryGetValue(menuKey.ToLower(), out menu)) {
            if (_openMenu.Menu != null) {
                _openMenu.Menu.SetActive(false);
            }
            _openMenu = new MenuPair(menuKey, menu);
            menu.SetActive(true);

            switch (menuKey.ToLower()) {
                case "deathmatch":
                    PlayerPrefs.SetInt("GameMode", (int)GameManager.GameModeChoice.DeathMatch);
                    break;
                case "lastmanstanding":
                    PlayerPrefs.SetInt("GameMode", (int)GameManager.GameModeChoice.LastManStanding);
                    break;
                default:
                    break;
            }

            Debug.Log(PlayerPrefs.GetInt("GameMode"));
        }
    }