コード例 #1
0
 void DontFuel()//Закончилось топливо
 {
     state = State.Dead;
     audioSource.Stop();
     audioSource.PlayOneShot(loseSound);
     deathMenu.ToggleEndMenu();
 }
コード例 #2
0
ファイル: SpaceshipMotor.cs プロジェクト: lsahatqija/Neuron
 private void EndGame()
 {
     isAlive = false;
     pauseButton.SetActive(false);
     AdManager.AdInstance.ShowAd();
     deathMenu.ToggleEndMenu(score);
 }
コード例 #3
0
ファイル: NumberMotor.cs プロジェクト: lsahatqija/Neuron
 public void PauseGame()
 {
     if (!isPaused)
     {
         deathMenu.ToggleEndMenu(score);
         isPaused = true;
     }
     else
     {
         deathMenu.UnToggleEndMenu();
         isPaused = false;
     }
 }
コード例 #4
0
 public void OnDeath()
 {
     isDeath = true;
     PlayerPrefs.SetFloat("Coin Score", CoinScore);
     deathMenu.ToggleEndMenu(CoinScore);
     ScoreforCoin.CoinScore = 0;
 }
コード例 #5
0
 public void OnDeath()
 {
     isDeath = true;
     PlayerPrefs.SetFloat("Highscore", score);
     deathMenu.ToggleEndMenu(score);
     Score.score = 0;
 }
コード例 #6
0
 // Player has died
 void OnGameOver()
 {
     GroundTrans.doSpawn = false;
     Scrolling.gameOver  = true;
     isGameOver          = true;
     deathMenu.ToggleEndMenu(score);  //show the death button when the player died
 }
コード例 #7
0
    public void OnDeath()
    {
        isDead = true;


        deathMenu.ToggleEndMenu(score);
    }
コード例 #8
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     deathMenu.ToggleEndMenu(score);
 }
コード例 #9
0
ファイル: Player.cs プロジェクト: davdwhyte87/Runny
    //private void OnCollisionEnter(Collision collision)
    //{
    //    if (collision.gameObject.tag == "Box" || collision.gameObject.tag == "FastBox")
    //    {
    //        Debug.Log("HIIITTT");
    //    }
    //}

    IEnumerator Wait()
    {
        //yield return new WaitForSeconds(2f);
        playerAnimation.CrossFade("Dying");
        yield return(new WaitForSeconds(1.5f));

        playerAnimation.Stop();
        deathMenu.ToggleEndMenu((int)score);
    }
コード例 #10
0
ファイル: Score.cs プロジェクト: johnnyn2/FYP-MusicRhythmGame
 public void OnDeath(bool win)
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score); // Set the highest score into Registry
     }
     deathMenu.ToggleEndMenu(score, win);
 }
コード例 #11
0
ファイル: Player.cs プロジェクト: MemoriZzz/FUFU_Game
 void Die()
 {
     //Debug.Log("Call Die()....");
     isDead = true;
     deathMenu.ToggleEndMenu(health);
     fixedJoystick.ToggleEndMenu();
     jumpBtn.ToggleEndMenu();
     fightBtn.ToggleEndMenu();
 }
コード例 #12
0
ファイル: Score.cs プロジェクト: omega64/ttwormhole3
 public void OnDeath()
 {
     iSDead = true;
     if ((int)PlayerPrefs.GetFloat("Highscore") < score)
     {
         NHS.text = "NEW HIGH SCORE!!";
         PlayerPrefs.SetFloat("Highscore", score);
     }
     deathMenu.ToggleEndMenu(score);
 }
コード例 #13
0
ファイル: Scoring1.cs プロジェクト: Vallabh04/RunningOnLava
    public void Ondeath()
    {
        isdead = true;
        if (PlayerPrefs.GetFloat("Hig") < score)
        {
            PlayerPrefs.SetFloat("Hig", score);
        }

        deathmenu.ToggleEndMenu(score);
    }
コード例 #14
0
ファイル: Score.cs プロジェクト: agwadan/Endless-Runner
 public void OnDeath(){
     isDead = true;
     if(PlayerPrefs.GetFloat("HighScore") < score){
         PlayerPrefs.SetFloat("HighScore", score);
     }
     
     deathMenu.ToggleEndMenu(score);
     int coinNumber = GetComponent<PlayerMotor>().coinCounter;
     PlayerPrefs.SetInt("CoinsCount", (PlayerPrefs.GetInt("CoinsCount") + coinNumber));//------ Adding the number of coins to the already stored number of coins.
 }
コード例 #15
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);            //Saving the score in the registery regedit(software,defaultcompany)
     }
     //PlayerPrefs.GetInt ("Highscore");
     deathMenu.ToggleEndMenu(score);
 }
コード例 #16
0
ファイル: Score.cs プロジェクト: ahmed-mahraf/Pitch-Block
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     scoreObject.SetActive(false);
     deathMenu.ToggleEndMenu(score);
 }
コード例 #17
0
ファイル: GameManager.cs プロジェクト: victoroff/Melting
    // public GameObject completeLevelUI;

    // complete level - we are not completing levels because it is endless sliding
    //public void CompleteLevel()
    //{
    //    Debug.Log("Level Won");
    //    completeLevelUI.SetActive(true);
    //}

    // end game function
    public void EndGame()
    {
        if (gameHasEnded == false)
        {
            gameHasEnded = true;


            //need to set score on death
            deathMenu?.ToggleEndMenu(0f);
        }
    }
コード例 #18
0
    private void Death()
    {
        m_isDead = true;
        if (PlayerPrefs.GetInt("Highscore") < m_numOfCollisionWithCoin)
        {
            Debug.Log("score2: " + PlayerPrefs.GetInt("Highscore"));
            PlayerPrefs.SetInt("Highscore", m_numOfCollisionWithCoin);
        }

        m_deathMenu.ToggleEndMenu(m_numOfCollisionWithCoin);
    }
コード例 #19
0
 public void OnDeath()
 {
     isDead = true;
     Debug.Log(PlayerPrefs.GetFloat("HighScore"));
     Debug.Log(score > PlayerPrefs.GetFloat("HighScore"));
     if (score > PlayerPrefs.GetFloat("HighScore"))
     {
         PlayerPrefs.SetFloat("HighScore", score);
     }
     deathMenu.ToggleEndMenu(score);
 }
コード例 #20
0
 public void OnDeath()
 {
     /*isDead = true;
      * if (PlayerPrefs.GetFloat("Highscore") < score)
      * {
      *  PlayerPrefs.SetFloat("Highscore", score);
      *  deathMenu.newBestText.enabled = true;
      * }
      * coins += coin;
      * PlayerPrefs.SetInt("Coins", coins);*/
     deathMenu.ToggleEndMenu(score, coin);
 }
コード例 #21
0
ファイル: score.cs プロジェクト: ConorTapley/ZombieRun
    public void OnDeath()
    {
        m_isDead = true;

        //if a new highscore is set update it
        if (PlayerPrefs.GetFloat("Highscore") < m_score)
        {
            PlayerPrefs.SetFloat("Highscore", m_score);
        }

        deathMenu.ToggleEndMenu(m_score); // show death menu
    }
コード例 #22
0
    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "Obstacle")
        {
            gameObject.SetActive(false);
            isDead = true;

            deathMenu.ToggleEndMenu();
            pauseScript.buttonToggleOff();
            scoreScript.TurnScoreOff();
        }
    }
コード例 #23
0
ファイル: Scoring.cs プロジェクト: Herooik/GameJam
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     Debug.Log("d");
     FindObjectOfType <WhiteScreen>().Kill();
     Debug.Log("d");
     deathMenu.ToggleEndMenu(score);
 }
コード例 #24
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("up") || Input.GetButtonDown("down") || Input.GetButtonDown("left") || Input.GetButtonDown("right"))
        {
            move = true;
        }

        if (move)
        {
            if (!isDead)
            {
                //*thePlayer's Z position will always be greater then the camera's Z position
                if (gameObject.transform.position.z < thePlayer.transform.position.z - 1)
                {
                    //lerps the camera towards the player
                    shouldPos = Vector3.Lerp(gameObject.transform.position, thePlayer.transform.position, Time.deltaTime);
                    gameObject.transform.position = new Vector3(shouldPos.x, 1, shouldPos.z);
                }
                else
                {
                    //slowly moves the camera forward until player is a certain amount pass the camera's Z position
                    gameObject.transform.position += Vector3.forward * (Time.deltaTime * speed);
                    gameObject.transform.position  = new Vector3(Mathf.Lerp(gameObject.transform.position.x, thePlayer.transform.position.x, Time.deltaTime), 1, gameObject.transform.position.z);
                }
                if (gameObject.transform.position.x <= -1)
                {
                    gameObject.transform.position = new Vector3(Mathf.Lerp(gameObject.transform.position.x, -1, Time.deltaTime), 1, gameObject.transform.position.z);
                }
                if (gameObject.transform.position.x >= 1)
                {
                    gameObject.transform.position = new Vector3(Mathf.Lerp(gameObject.transform.position.x, 1, Time.deltaTime), 1, gameObject.transform.position.z);
                }
            }
            if (gameObject.transform.position.z > thePlayer.transform.position.z + 5)
            {
                //sets isDead to true and snaps camera to the player's position
                isDead = true;
                thePlayer.GetComponent <Bounce>().isDead = true;
                thePlayer.GetComponent <AnimationController>().isDead = true;
                shouldPos = Vector3.Lerp(gameObject.transform.position, thePlayer.transform.position, Time.deltaTime);
                gameObject.transform.position = new Vector3(shouldPos.x, 1, shouldPos.z - 4);
                deathMenu.ToggleEndMenu();    //calls the death menu
                gameMenu.ToggleOffGameMenu(); //turns off game menu icons
            }
        }
        //this will snap the camera to the player's position when dead
        if (isDead)
        {
            shouldPos = Vector3.Lerp(gameObject.transform.position, thePlayer.transform.position, Time.deltaTime * 2);
            gameObject.transform.position = new Vector3(shouldPos.x, 1, shouldPos.z);
        }
    }
コード例 #25
0
 //Arret du score quand le joueur perd
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("HighScore Distance :") < score_distance)
     {
         PlayerPrefs.SetFloat("HighScore Distance :", score_distance);
     }
     if (PlayerPrefs.GetFloat("HighScore Piece :") < count_piece)
     {
         PlayerPrefs.SetFloat("HighScore Piece :", count_piece);
     }
     deathMenu.ToggleEndMenu(score_distance, count_piece);
 }
コード例 #26
0
    public void OnDeath()
    {
        // this method will be called from the playerMotor script;
        // when player collides with onj, this method will be called in PlayerMotor and will stop the Score from increasing
        isDead = true;

        if (PlayerPrefs.GetFloat("Highscore") < score)         // if highscore is smaller than score assign new highscore.
        {
            PlayerPrefs.SetFloat("Highscore", score);          // save the score to the user's device's storage
        }

        deathMenu.ToggleEndMenu(score);         // turns on the death menu, and sends the player's score to be displayed on the death menu
    }
コード例 #27
0
    public void OnDeath()
    {
        isDead = true;
        //deathMenu.ToggleEndMenu(score);
        if ((int)PlayerPrefs.GetFloat("Highscore") < score)
        {
            NHS.text = "NEW HIGH SCORE!!";

            PlayerPrefs.SetFloat("Highscore", score);
        }
        deathMenu.ToggleEndMenu(score);
        AddScoreToLeaderBoard(lead, (int)score);
    }
コード例 #28
0
    void OnTriggerEnter(Collider other)
    {
        /*
         * Player.transform.position = respawnPoint.transform.position;
         * Debug.Log("You die!!"); */

        if (other.gameObject.tag == "Player")
        {
            deathMenu.ToggleEndMenu();
            //Destroy(gameObject);
            Debug.Log("You die! Back to start place!");
            Player.transform.position = respawnPoint.transform.position;
        }
    }
コード例 #29
0
 private void endGame()
 {
     GameObject.FindGameObjectWithTag("Life" + life).SetActive(false);
     LifeLost[LifeCounter].SetActive(true);
     //GameObject.FindGameObjectWithTag("LifeLost" + life).SetActive(true);
     LifeCounter++;
     life -= 1;
     if (life == 0)
     {
         ended = true;
         speed = 0;
         deathMenu.ToggleEndMenu(Score.GetComponent <ManageScore>().score);
     }
 }
コード例 #30
0
 public void Death()
 {
     if (!mute)
     {
         orig.Stop();
         slow.Play();
     }
     isDead = true;
     zm.onDead();
     cm.onDead();
     gm.onDead();
     GetComponent <BallMovement>().onDead();
     deathMenu.ToggleEndMenu();
 }