示例#1
0
    // Update is called once per frame
    void Update()
    {
        // 스코어 레이블을 업데이트
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        // 라이프 패널을 업데이트
        lifePanel.UpdateLife(nejiko.Life());

        // 네지코의 라이프가 0이 되면 게임 종료
        if (nejiko.Life() <= 0)
        {
            // 이 이후의 업데이트는 멈춘다.
            enabled = false;

            // 하이 스코어를 업데이트
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            // 2초 후에 ReturnToTile을 호출
            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#2
0
    public void Update()
    {
        // Update Score label
        AddToScore(CalcScore());
        scoreLabel.text = "Score : " + (int)score;

        // Update Life Panel
        lifePanel.UpdateLife(nejiko.Life);

        // Close game when life count become 0
        if (nejiko.Life <= 0)
        {
            // Stop more update
            enabled = false;

            // Update high score
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", (int)score);
            }

            // Call ReturnToTile in 2 seconds
            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#3
0
    // Update is called once per frame
    void Update()
    {
        // スコア更新
        int score = CalcScore() / 10;

        scoreLabel.text = "すこあ:" + score + "めーとる";

        lifePanel.UpdateLife(nejiko.Life());

        // ネジ子のライフが0になったら
        if (nejiko.Life() <= 0)
        {
            // updateを止める
            enabled = false;

            // ハイスコアの更新
            if (PlayerPrefs.GetInt("HightScore") < score)
            {
                PlayerPrefs.SetInt("HightScore", score);
            }

            // 2秒後に呼び出す
            Invoke("ReturnTitle", 2.0f);
        }
    }
示例#4
0
    // Update is called once per frame
    void Update()
    {
        //スコアラベルを更新
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";
        //ライフパネルを更新
        lifePanel.UpdateLife(nejiko.Life());

        //ねじ子のライフが0になったらゲームオーバー
        if (nejiko.Life() <= 0)
        {
            //これ以降のUpdateは止める
            enabled = false;


            //コルーチンにしたゲーム終了処理を開始
            StartCoroutine(ReturnToTitle(score));


            ////ハイスコア更新
            //if(PlayerPrefs.GetInt("HighScore") < score)
            //{
            //    PlayerPrefs.SetInt("HighScore", score);
            //}

            //// 2秒後にReturnToTitleを呼び出す
            //Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#5
0
    public void Update()
    {
        // スコアラベルを更新
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        // ライフパネルを更新
        lifePanel.UpdateLife(nejiko.Life());

        // ねじ子のライフが0になったらゲームオーバー
        if (nejiko.Life() <= 0)
        {
            // これ以降のUpdateは止める
            enabled = false;

            // ハイスコアを更新
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            // 2秒後にReturnToTitleを呼びだす
            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#6
0
    void Update()
    {
        Countdown -= Time.deltaTime;
        timer.text = Countdown.ToString("00.00");
        if (hp > 20 && hp <= 30)
        {
            life = 3;
        }
        if (hp > 10 && hp <= 20)
        {
            life = 2;
        }
        else if (hp > 0 && hp <= 10)
        {
            life = 1;
        }
        else if (hp <= 0)
        {
            life = 0;
            ChangeScene(currentScene);
        }
        else if (Countdown <= 0)
        {
            ChangeScene(currentScene);
        }

        lifePanel.UpdateLife(life);
        if (hp > 0 && score >= maxScore)
        {
            ChangeScene(nextScene);
        }
    }
示例#7
0
    // Update is called once per frame
    void Update()
    {
        //スコアラベルを更新
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        //ライフパネルを更新
        //NejikoControllerからハート数を取得
        lifePanel.UpdateLife(nejiko.Life());

        //ねじこのライフが0になったらゲームオーバー
        if (nejiko.Life() <= 0)
        {
            //これ以降のUpdateはとめる
            enabled = false;

            //ハイスコアの更新

            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            //2秒後にReturnToTitleを呼び出す
            Invoke("ReturnToTitle", 2.0f);
        }
    }
    // Update is called once per frame
    void Update()
    {
        TimerText.text = "" + LimitTime.ElapsedMilliseconds / 1000f;
        if (Weapon.S.curSelectWeapon == WeaponType.pistol)
        {
            RemainBulletText.text = "" + Weapon.S.pistol.remainBullet + " / 50";
        }
        if (Weapon.S.curSelectWeapon == WeaponType.rocketLauncher)
        {
            RemainBulletText.text = "" + Weapon.S.rocket.remainBullet + " / 1";
        }
        lifePanel.UpdateLife(Hero.S.life);
        switch (Weapon.S.curColor)
        {
        case ColorType.red:
            ColorText.text  = "Red";
            ColorText.color = Color.red;
            break;

        case ColorType.green:
            ColorText.text  = "Green";
            ColorText.color = Color.green;
            break;

        case ColorType.blue:
            ColorText.text  = "Blue";
            ColorText.color = Color.blue;
            break;
        }
        if (LimitTime.ElapsedMilliseconds / 1000f > 30f)
        {
            SceneManager.LoadScene("necoisland");
        }
    }
示例#9
0
    public AudioClip gameoversound; //hyh


    public void Update()
    {
        // 스코어 레이블을 업데이트
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        // 라이프 패널을 업데이트
        lifePanel.UpdateLife(player.Life());

        if (player.Life() <= 0)
        {
            AudioSource.PlayClipAtPoint(gameoversound, transform.position);//hyh

            //이 이후의 업데이트는 멈춘다
            enabled = false;
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            exitLabel.text = "Cheer up ! Let's go home";
            //after 2second call ReturnToTitle function
            Invoke("ReturnToTitle", 1.5f);
        }
    }
示例#10
0
 // Use this for initialization
 // Update is called once per frame
 void Update()
 {
     lifepanel.UpdateLife(user.getLife());
     if (ene1 == null && ene2 == null)
     {
         Instantiate(win, loc.position, loc.rotation);
     }
     if (player == null)
     {
         Instantiate(lose, loc.position, loc.rotation);
     }
 }
    // Update is called once per frame
    void Update()
    {
        //ライフの表示
        lifePanel.UpdateLife(controller.Life());
        //スコアの表示
        scoreLabel.text = "Score : " + score;


        //エスケープキーでゲーム終了
        if (Input.GetKey(KeyCode.Escape))
        {
            Application.Quit();
        }
    }
示例#12
0
    public void Update()
    {
        // 스코어 레이블을 업데이트
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        // whenever score is increased more, the speed for character will be faster !
        if (score >= 200 && score <= 400 && score_set_once == false)
        {
            player.speedZ += 3;
            score_set_once = true;
        }
        else if (score > 400 && score <= 700 && score_set_once == true)
        {
            player.speedZ += 2;
            score_set_once = false;
        }
        else if (score > 700 && score <= 1100 && score_set_once == false)
        {
            player.speedZ += 2;
            score_set_once = true;
        }
        else if (score > 1100 && score <= 1500 && score_set_once == true)
        {
            player.speedZ += 1;
            score_set_once = false;
        }

        // 라이프 패널을 업데이트
        lifePanel.UpdateLife(player.Life());

        if (player.Life() <= 0)
        {
            AudioSource.PlayClipAtPoint(gameoversound, transform.position);//hyh

            //이 이후의 업데이트는 멈춘다
            enabled = false;
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            int point = PlayerPrefs.GetInt("Point");
            PlayerPrefs.SetInt("Point", score / 10 + point);
            exitLabel.text = "Cheer up ! Let's go home";
            //after 2second call ReturnToTitle function
            Invoke("ReturnToTitle", 1.5f);
        }
    }
    // Update is called once per frame
    void Update()
    {
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        lifePanel.UpdateLife(nejiko.Life());

        if (nejiko.Life() <= 0)
        {
            enabled = false;

            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#14
0
    // Update is called once per frame
    public void Update()
    {
        int score = CalcScore();

        scoreText.text = "Score:" + score + "m";
        lifePanel.UpdateLife(nejiko.Life());
        if (nejiko.Life() <= 0)
        {
            enabled = false;
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }
            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#15
0
    void Update()
    {
        int score = (int)_player.transform.position.z;

        txtScore.text = score + "m";

        _life.UpdateLife(_player.Life);

        if (_player.Life <= 0)
        {
            if (score > PlayerPrefs.GetInt("highScore"))
            {
                PlayerPrefs.SetInt("highScore", score);
            }

            // 2초후에 title씬으로 이동
            Invoke("ReturnToTitle", 2f);
        }
    }
示例#16
0
    public void Update()
    {
        //お金更新
        int money = nejiko.Money();

        moneyLabel.text = "Money: " + money + "$";

        //スコア更新
        int score = CalcScore();

        scoreLabel.text = "Score: " + score + "m";

        //ライフパネルを更新
        lifePanel.UpdateLife(nejiko.Life());

        //ネジ子のライフが0になったらゲームオーバー
        if (nejiko.Life() <= 0)
        {
            //これ以降のUpdateはやめる
            enabled = false;

            //ハイスコア更新
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            //2秒後にReturnToTitleを呼び出す
            Invoke("ReturnToTitle", 2.0f);
        }

        if (nejiko.Position() >= 500.0f)
        {
            enabled = false;
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }
            //2秒後にReturnToTitleを呼び出す
            Invoke("ReturnToStageSerect", 2.0f);
        }
    }
示例#17
0
    // Update is called once per frame
    void Update()
    {
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + " m";
        lifePanel.UpdateLife(nejiko.Life());

        if (nejiko.Life() <= 0)
        {
            enabled = false; // 업데이트 종료

            //하이스코어 저장.
            if (PlayerPrefs.GetInt("HighScore") < score)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            Invoke("ReturnToTitle", 2.0f); // Invoke는 지정한 함수를 일정 시간 뒤에 실행.
        }
    }
示例#18
0
    // Update is called once per frame
    void Update()
    {
        //スコアラベルを更新
        int score = CalcScore();

        scoreLabel.text = "Score : " + score + "m";

        //ライフパネルを更新
        lifePanel.UpdateLife(nejiko.Life());

        //ねじ子のライフが0になったらゲームオーバー
        if (nejiko.Life() <= 0)
        {
            //これ以降はUpdateは止める
            enabled = false;

            //2秒後にReturnToTitleを呼び出す
            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#19
0
    void Update()
    {
        if (highScore < score)
        {
            highScore = score;
        }

        highScoreLabel.text = "" + highScore;
        scoreLabel.text     = "" + score;
        grazeLabel.text     = "" + graze.Grazer();
        lifePanel.UpdateLife(player.Life());
        bombPanel.UpdateBomb(player.Bomb());

        enemyTypeLabel.text = "第" + enemy.Type() + "段階";
        if (enemy.Type() == 4)
        {
            spelName.text = "禁忌:百花繚乱";
        }
        if (enemy.Type() == 5)
        {
            spelName.text = "禁忌:春夏秋冬";
        }
    }
示例#20
0
    void Update()
    {
        // 점수 업데이트
        score           = CalcScore() + itemscore;
        scoreLabel.text = score.ToString();

        // 생명 업데이트
        lifePanel.UpdateLife(player.Life());

        // 생명 개수 0 되거나 떨어지면 게임 종료
        if (player.Life() <= 0 || player.transform.position.y < 0)
        {
            // 더이상 업데이트 안함
            enabled = false;

            // 하이스코어 업데이트
            if (highscore < score)
            {
                highscore = score;
            }

            loadEnd();
        }
    }
示例#21
0
    // Update is called once per frame
    void Update()
    {
        int score = CalcScore();

        scoreLabel.text = "Score: " + score + "m";

        lifePanel.UpdateLife(nejiko.Life());

        // ライフが 0 になったらゲームオーバー
        if (nejiko.Life() <= 0)
        {
            // Update処理を止める
            enabled = false;

            // ハイスコアを PlayerPrefs に保存
            if (score > PlayerPrefs.GetInt("HighScore"))
            {
                PlayerPrefs.SetInt("HighScore", score);
            }

            // 2秒待ち、タイトルへ戻す。 Invoke関数により遅延実行
            Invoke("ReturnToTitle", 2.0f);
        }
    }
示例#22
0
 void Update()
 {
     lifePanel1.UpdateLife(Player1.Life());
     lifePanel2.UpdateLife(Player2.Life());
 }
示例#23
0
 // Update is called once per frame
 void Update()
 {
     lifePanel.UpdateLife(unitychan.Life());
 }
示例#24
0
 // Update is called once per frame
 public void Update()
 {
     lifePanel.UpdateLife(ship.Life());
 }