Beispiel #1
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.gameObject.tag == "Face")
        {
            ReSpawn();
            if (GameController.Instance.gamePhase != GameController.GamePhase.Phase4)
            {
                GameController.Instance.enemyList.Remove(this.gameObject);
                Destroy(this.gameObject);
            }
        }

        else if (collider.gameObject.tag == "Missile")
        {
            TargetReset.Instance.Reset();
            ScoreInfo.HitUfo();
            K_Score.Instance.hitUfo = true;
            K_Score.Instance.ufoDefeatCount++;
            hp--;
            if (hp <= 0)
            {
                ReSpawn();
                if (GameController.Instance.gamePhase != GameController.GamePhase.Phase4)
                {
                    GameController.Instance.enemyList.Remove(this.gameObject);
                    Destroy(this.gameObject);
                }
            }
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            ScoreInfo.HitUfo();
        }
        else if (Input.GetKeyDown(KeyCode.S))
        {
            ScoreInfo.HitMeteorSmall();
        }
        else if (Input.GetKeyDown(KeyCode.D))
        {
            ScoreInfo.HitMeteorNormal();
        }
        else if (Input.GetKeyDown(KeyCode.F))
        {
            ScoreInfo.HitMeteorBig();
        }
        else if (Input.GetKeyDown(KeyCode.G))
        {
            ScoreInfo.HitMars();
        }
        else if (Input.GetKeyDown(KeyCode.Q))
        {
            //セーブ
            //Debug.ClearDeveloperConsole();

            //ハイスコアを確認して、今の点数が今までのハイスコア5つと比べて何番目かを確認している
            ScoreInfo.AddToHighScores();
            //Debug.Log(ScoreInfo.GetTotalScore());
            nameCount++;

            //スコアを新しく作る
            ScoreInfo.Score = new Score();

            //気にしない
            ScoreInfo.Score.Name = "Name " + nameCount;
        }
        //else if (Input.GetKeyDown(KeyCode.W))
        //{

        //    ScoreInfo.SortScoreDescending();
        //}
    }