Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        // oキー
        if (Input.GetKeyDown(KeyCode.O))
        {
            NextScene = "Game Over";
            // cキー
        }
        else if (Input.GetKeyDown(KeyCode.C))
        {
            NextScene = "Clear";
        }
        //Aキー
        else if (Input.GetKey(KeyCode.A))
        {
            GameParams.AddScore(1000);
        }

        if (NextScene.Length > 0)
        {
            SceneManager.LoadSceneAsync(NextScene, LoadSceneMode.Additive);
            NextScene = "";
            enabled   = false;
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        //GameParams.AddScore (1);

        // Oキー
        if (Input.GetKeyDown(KeyCode.O))
        {
            NextScene = "GameOver";
        }
        // Cキー
        else if (Input.GetKeyDown(KeyCode.C))
        {
            NextScene = "Clear";
            NextScene = "GameOver";
        }
        // Aキー
        else if (Input.GetKey(KeyCode.A))
        {
            GameParams.AddScore(50000);
        }



        // シーン切り替え処理
        if (NextScene.Length > 0)
        {
            OnDestroy();
            SceneManager.LoadSceneAsync(NextScene, LoadSceneMode.Additive);
            NextScene = "";
            enabled   = false;
        }
    }
Exemplo n.º 3
0
    private void OnCollisionEnter(Collision collision)
    {
        if (!GameBehaviour.isPlayable)
        {
            return;
        }

        if (collision.gameObject.CompareTag("Player"))
        {
            sphereCollider.enabled = false;
            rb.velocity            = Vector3.zero;

            SoundManager.PlaySE(SoundManager.AUDIO_LIST.ITEM);

            GameParams.AddScore(point * EnemySpawner.enemyCount);
            EnemySpawner.IncrementEnemy();
            EnemySpawner.ChangeDir();
            anim.SetTrigger("Get");

            if (getParticle != null)
            {
                Instantiate(getParticle, transform.position, Quaternion.identity);
            }
        }
    }
Exemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        //GameParams.AddScore (1);

        if (Input.GetKeyDown(KeyCode.O))
        {
            NextScene = "gameover";
        }
        else if (Input.GetKeyDown(KeyCode.C))
        {
            NextScene = "clear";
            NextScene = "gameover";
        }
        //Aキー
        else if (Input.GetKey(KeyCode.A))
        {
            GameParams.AddScore(10000);
        }
        else if (Input.GetMouseButtonDown(1))
        {
            GameParams.AddScore(10000);
        }
        if (NextScene.Length > 0)
        {
            SceneManager.LoadSceneAsync(NextScene, LoadSceneMode.Additive);
            NextScene = "";
            enabled   = false;
        }
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        /*// Oキー
         * if (Input.GetKeyDown (KeyCode.O)) {
         *      NextScene = "GameOver";
         * }
         * // Cキー
         * else if (Input.GetKeyDown (KeyCode.C)){
         *      NextScene = "Clear";
         *      NextScene = "GameOver";
         * }*/


        GameParams.AddScore(-50);


        // シーン切り替え処理
        if (NextScene.Length > 0)
        {
            OnDestroy();
            SceneManager.LoadSceneAsync(NextScene, LoadSceneMode.Additive);
            NextScene = "";
            enabled   = false;
        }
    }
Exemplo n.º 6
0
    private void FixedUpdate()
    {
        if (!isPlayable)
        {
            return;
        }

        GameParams.AddScore((float)EnemySpawner.enemyCount * Time.fixedDeltaTime);
    }
Exemplo n.º 7
0
 private void AddScoreOnDistance(float offsetD)
 {
     if (distance >= offsetD)
     {
         startPosX = transform.position.x;
         distance  = 0f;
         GameParams.AddScore(1);
         GameParams.AddLastScore(1);
     }
     distance = transform.position.x - startPosX;
 }
Exemplo n.º 8
0
 private void Landing(string infoText, int score)
 {
     gm.GetGUI().infoDrop.SetActive(true);
     gm.GetGUI().drop.text = infoText;
     gm.GetGUI().valDrop.text = "+" + score.ToString();
     Debug.Log(infoText + " : " + score.ToString());
     GameParams.AddScore(score);
     GameParams.AddLastScore(score);
     GameParams.SetScore(GameParams.GetScore() * curValFlip);
     GameParams.SetLastScore(GameParams.GetScore());
     am.PlayLanding();
     curValFlip = 0;
     StartCoroutine(HideInfoDrop(1f));
     _backFlip = false;
 }
Exemplo n.º 9
0
    void OnTriggerEnter(Collider col)
    {
        if (col.CompareTag("Player"))
        {
            if (CompareTag("Item"))
            {
                GameParams.AddScore(100);
                Destroy(gameObject);

                BallCount--;
                //CountText.text = "" + BallCount;
                if (BallCount <= 0)
                {
                    GameManager.NextScene = "Clear";
                }
            }
        }
    }
Exemplo n.º 10
0
    void OnMouseOver()
    {
        //Debug.Log ("10");
        //if (Input.GetMouseButtonDown(0)) {
        //		Debug.Log ("11");
        //Vector3 mpos = Input.mousePosition;
        if (Input.GetButtonDown("Fire1"))
        {
            BallCrate.countball -= 1;

            //効果音
            GameManager.PlaySE(4);

            if (CompareTag("mato"))
            {
                GameParams.AddScore(1000);
                scoretext.TextCreate(1000);
                Destroy(gameObject);
            }
            if (CompareTag("mato1"))
            {
                GameParams.AddScore(600);
                scoretext.TextCreate(600);
                Destroy(gameObject);
            }
            if (CompareTag("mato2"))
            {
                GameParams.AddScore(350);
                scoretext.TextCreate(350);
                Destroy(gameObject);
            }


            if (BallCrate.high != 33)
            {
                BallCrate.high += 11;
            }
            else
            {
                BallCrate.high = 11;
            }
        }
    }
Exemplo n.º 11
0
    void OnTriggerEnter(Collider col)
    {
        if (col.CompareTag("Player"))
        {
            if (CompareTag("itrm"))
            {
                GameParams.AddScore(100);
                Destroy(gameObject);
                ballCount--;
                //	CountText.text = "" + ballCount;

                if (ballCount <= 0)
                {
                    gamemanager.NextScene = "clear";
                }
            }

            Destroy(gameObject);
        }
    }
Exemplo n.º 12
0
 private void AddScoreInFliying(float time1, float time2)
 {
     if (!IsGrounded())
     {
         if (timerFly >= time1)
         {
             if (timerFlying >= time2)
             {
                 GameParams.AddScore(1);
                 GameParams.AddLastScore(1);
                 timerFlying = 0f;
             }
             timerFlying += Time.deltaTime;
         }
         timerFly += Time.deltaTime;
     }
     else if (IsGrounded())
     {
         timerFly    = 0f;
         timerFlying = 0f;
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// スコアを加算
 /// </summary>
 /// <param name="sc">加算</param>
 public override void AddScore(int sc)
 {
     GameParams.AddScore(sc);
     scoreText.text = "SCORE " + GameParams.ScoreString;
 }