Пример #1
0
 public void EndGame()
 {
     finalScore = score.GetScore();
     StartCoroutine(hsController.PostScores(MainMenu.pseudo, score.GetScore()));
     cameraController.LaunchEndGameEffect();
     StartCoroutine(End());
 }
Пример #2
0
    private void SubmitName(string username)
    {
        int          distance = PlayerPrefs.GetInt("Distance");
        int          bananas  = PlayerPrefs.GetInt("Bananas");
        int          score    = 60 * distance + 40 * bananas;
        HSController HS       = new HSController();

        StartCoroutine(HS.PostScores(username, score, distance, bananas));
        StartCoroutine(HS.GetScores());
    }
Пример #3
0
 public void onClicTak()    ///obsługa przycisku na scenie, zapis do systemu rankingowego
 {
     if (nick != "null")
     {
         StartCoroutine(comm.PostScores(timer, movesCounter, pointsCounter, nick, currentTabSize, currentMode));
     }
     else
     {
         SceneManager.LoadScene("nullName");
     }
 }
Пример #4
0
    void OnGUI()
    {
        GUI.skin = practiceskin;
        GUI.Box(new Rect(Screen.width - 100, 0, 60, 60), scor.ToString());
        string msg = "FINAL SCORE: " + scor;

        if (gameover)
        {
            if (checkifhighscore(scor))
            {
                if (userHasHitReturn == false)
                {
                    string newscore = "NEW HIGHSCORE: " + scor + "\nENTER YOUR NAME:";
                    windownewscor = GUI.Window(0, windownewscor, DoMyNewScore, newscore);
                }
                else
                {
                    if (posted == false)
                    {
                        StartCoroutine(hs.PostScores(namePlayer, scor));
                        posted = true;
                    }
                    window = GUI.Window(0, window, DoMyScores, "HIGHSCORES");
                }
            }
            else
            {
                if (writing == false)
                {
                    if (read == false)
                    {
                        StartCoroutine(hs.GetScores());
                        read = true;
                    }
                    getscores();
                    window = GUI.Window(0, window, DoMyScores, "HIGHSCORES");
                }
            }
        }
    }
Пример #5
0
    void OnGUI()
    {
        GameObject shipInfo   = GameObject.Find("MonkeyShip");
        GameObject cameraInfo = GameObject.Find("Main Camera");

        //GUI.Label (new Rect (0, 20, 150, 100), "Screen DPI: " + Screen.dpi);
        scoreStyle.fontSize = (int)(Screen.width * 0.03);
        GUI.Label(new Rect(Screen.width * 0.4f, Screen.height * 0.05f, Screen.width * 0.3f, Screen.height * 0.4f), "Score: " + (int)Mathf.Round(score), scoreStyle);

        // Show game over menu

        // Submit highscore via return key on keyboard
        Event e = Event.current;

        if (e.keyCode == KeyCode.Return && submitted == false)
        {
            gameover = false;
            highScoreScript.StartCoroutine(highScoreScript.PostScores(stringToEdit, (int)Mathf.Round(score)));
            submitted = true;
            Debug.Log("You have successfully submitted name: " + stringToEdit + " Score: " + (int)Mathf.Round(score));
            StartCoroutine("Submitted");
        }
    }
Пример #6
0
 public void SendHS()
 {
     HS.StartCoroutine(HS.PostScores(EnterName.text, Int32.Parse(EnterValue.text)));
     transform.parent.gameObject.SetActive(false);
 }
Пример #7
0
    void OnGUI()
    {
        int menuWidth  = (int)(Screen.width * 0.6);
        int menuHeight = (int)(Screen.height * 0.7);
        int xStart     = Screen.width / 2 - menuWidth / 2;
        int yStart     = (int)(Screen.height * 0.2);
        int xOfsset    = (int)(menuWidth * 0.2);
        int yOfsset    = (int)(Screen.height * 0.1);

//		GameObject grid = GameObject.Find ("Grid");
//		var gridScript = grid.GetComponent<Grid> ();
        //GUI.Box (new Rect (0, 0, menuWidth * 0.45f, yOfsset), "max:" + gridScript.maxHeight ());
        GUI.Box(new Rect(0, 0, menuWidth * 0.45f, yOfsset), "Player Score: " + player_score);
        if (gameType == 2)
        {
            if (GUI.Button(new Rect(25, 50, menuWidth * 0.6f, yOfsset), comPlay ? "Computer Control" : "Player Control"))
            {
                comPlay = !comPlay;
                if (comPlay)
                {
                    GameObject shapeMaker       = GameObject.Find("ShapeMaker");
                    var        shapeMakerScript = shapeMaker.GetComponent <ShapeMakerScript> ();
                    var        shape            = shapeMakerScript.lastShape;

                    var kaka = shape.AddComponent <PathFinder> ();
                    kaka.cube = shapeMakerScript.cube;
                }
            }
        }

        if (!pause && enterName)
        {
            stringToEdit = GUI.TextField(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 3), menuWidth * 0.6f, yOfsset), stringToEdit, 25);
            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 4), menuWidth * 0.6f, yOfsset), "Submit Score"))
            {
                //GameObject HScont = GameObject.Find ("HSController");
                //var HScontScript = HScont.GetComponent<Grid> ();
                StartCoroutine(HSController.PostScores(stringToEdit, player_score));
                enterName = false;
            }
        }
        if (pause)
        {
            GUI.Box(new  Rect(xStart, yStart, menuWidth, menuHeight), "Game Paused");
            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)yStart + yOfsset, menuWidth * 0.6f, yOfsset), "Resume Game"))
            {
                //ResetGame();
                pause = false;
            }

            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 2.5), menuWidth * 0.6f, yOfsset), "Restart Game"))
            {
                //ResetGame();
                Application.LoadLevel("MainScene");
            }

            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 4), menuWidth * 0.6f, yOfsset), "Exit to main menu"))
            {
                Application.LoadLevel("MainMenuScene");
            }

            if (GUI.Button(new Rect(Screen.width - 105, 5, 100, 60), "Sound: ON/OFF"))
            {
                GameObject sound = GameObject.Find("Korobeiniki3");
                if (sound.audio.mute)
                {
                    sound.audio.mute = false;
                }
                else
                {
                    sound.audio.mute = true;
                }
            }
        }
    }
Пример #8
0
        public void GameOver()
        {
            StartCoroutine(HSController.PostScores(PrefsManager.GetName(), _score));

            GSAppExampleControl.Instance.LoadScene(ESceneNames.Arena);
        }