Example #1
0
    public void StartGame()
    {
        string s;

        if (GetGameIsReady(out s))
        {
            if (singleplayer)
            {
                PlayerPrefManager.SetInt("game_playercount", 1);
                PlayerPrefManager.SetString("game_p1_plane", p1Plane.ToString());
                PlayerPrefManager.SetString("game_p1_input", PlayerInput.InputType.DUAL.ToString());
            }
            else
            {
                PlayerPrefManager.SetInt("game_playercount", 2);
                PlayerPrefManager.SetString("game_p1_plane", p1Plane.ToString());
                PlayerPrefManager.SetString("game_p1_input", p1Input.ToString());
                PlayerPrefManager.SetString("game_p2_plane", p2Plane.ToString());
                PlayerPrefManager.SetString("game_p2_input", p2Input.ToString());
            }
            PlayerPrefManager.SetString("game_difficulty", difficulty.ToString());
            PlayerPrefManager.SetString("game_currentstage", stage.ToString());
            LevelLoader.current.LoadStage(stage);
        }
        else
        {
            Debug.LogError("this line shouldnt be reachable since the button should be disabled if the game cant be started");
        }
    }
Example #2
0
 public void CycleStage()
 {
     stage          = NextFromArray <LevelLoader.Stage>(stage, stages);
     stageText.text = stage.ToString();
 }
Example #3
0
 void LoadCurrentStageName()
 {
     currentStage = LevelLoader.ParseStage(PlayerPrefManager.GetString("game_currentstage"));
     Debug.Log(currentStage.ToString());
 }