public void haiten(int remove_cnt)
    {
        Score    = ((point + (25 * remove_cnt)) * remove_cnt); //ポイントを計算している
        points   = points + Score;                             //イベント発生のための計算
        pointx   = pointx + Score;
        addScore = Score;
        scoreGUI.SendMessage("AddPoint", Score);//ポイントの計算をしたものを画面に出しているもの
        addScoreGUI.SendMessage("AddPoint1", addScore);
        if (remove_cnt >= 8)
        {
            e += 1;
            GameObject[] ball = GameObject.FindGameObjectsWithTag("Respawn");
            foreach (GameObject obs in ball)
            {
                Destroy(obs);
                Instantiate(explosion1, obs.transform.position, obs.transform.rotation);
                Instantiate(explosion2, transform.position, transform.rotation);
                GetComponent <AudioSource>().Play();
            }

            if (remove_cnt > 9)
            {
                pointx = pointx + 50000 + 5000 * (remove_cnt % 10);
                scoreGUI.SendMessage("AddPoint", (50000 + 5000 * (remove_cnt % 10)));
                addScoreGUI.SendMessage("AddPoint1", (addScore + (50000 + 5000 * (remove_cnt % 10))));
            }

            scoreGUI.SendMessage("AddPoint", 50000);
            addScoreGUI.SendMessage("AddPoint1", (addScore + 50000));
            pointx = pointx + 50000;
            BallScript.SendMessage("DropBall", 60 - remove_cnt);
            points = 0;
        }
    }
Exemple #2
0
 public void Exchange()
 {
     //配列に「respawn」タグのついているオブジェクトを全て格納
     GameObject[] piyos = GameObject.FindGameObjectsWithTag("Respawn");
     //全て取り出し、削除
     foreach (GameObject obs in piyos)
     {
         Destroy(obs);
     }
     //ballScriptのDropBallメソッドを実行し、50のひよこを作成
     BallScript.SendMessage("DropBall", 50);
 }
Exemple #3
0
 public void Exchange()
 {
     //配列に「respawn」タグのついているオブジェクトを全て格納
     GameObject[] ball = GameObject.FindGameObjectsWithTag("Respawn");
     if (time >= 5)
     {
         foreach (GameObject obs in ball)
         {
             Destroy(obs);
         }
         BallScript.SendMessage("DropBall", 60);
         time = 0;
         GetComponent <AudioSource>().Play();
     }
 }