Exemplo n.º 1
0
    void Update()
    {
        GameObject   game_control = GameObject.Find("Main Camera");
        Game_control game_script  = game_control.GetComponent <Game_control>();

        if (game_script.game_state == Game_control.PLAYING)
        {
            //まだゲーム中なら
            e_count++;  //カウンター

            //一定時間経過で敵生成
            if (e_count > e_time)
            {
                Instantiate(e_prefab, transform.position, Quaternion.identity);
                e_count = 0;
                e_body_count++;

                //敵5体おきに生成の速さを増やす
                if (e_body_count % 5 == 0 && e_body_count != 0)
                {
                    if (e_time >= 30)
                    {
                        e_time -= 10;
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    private void Start()
    {
        //count_left = 0;
        //count_right = 0;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController");

        gameControl = gameControllerObject.GetComponent <Game_control>();
    }
Exemplo n.º 3
0
    void Update()
    {
        GameObject   game_control = GameObject.Find("Main Camera");
        Game_control game_script  = game_control.GetComponent <Game_control>();

        if (game_script.game_state == Game_control.PLAYING)
        {
            enemy_move();
        }
    }
Exemplo n.º 4
0
    void Start()
    {
        score = 0;
        //count = 0;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController");

        gameControl = gameControllerObject.GetComponent <Game_control>();
        UpdateScore();
        StartCoroutine(SpawnWaves());
    }
Exemplo n.º 5
0
    void Start()
    {
        aud = GetComponent <AudioSource>();
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController");

        if (gameControllerObject != null)
        {
            GameController = gameControllerObject.GetComponent <Game_control>();
        }
        if (GameController == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
Exemplo n.º 6
0
    void player_die()
    {
        GameObject   game_control = GameObject.Find("Main Camera");
        Game_control game_script  = game_control.GetComponent <Game_control>();

        game_script.game_state = Game_control.FINISH;

        GetComponent <Renderer>().material.color = Color.blue;
        transform.position = new Vector3(transform.position.x, transform.position.y, -10);

        //パーティクルを発生させる
        Instantiate(p_particle, transform.position, transform.rotation);
        die_pass = true;
    }
Exemplo n.º 7
0
    // Update is called once per frame
    void Update()
    {
        GameObject   game_control = GameObject.Find("Main Camera");
        Game_control game_script  = game_control.GetComponent <Game_control>();

        if (game_script.game_state == Game_control.PLAYING)
        {
            //まだゲーム中なら
            if (Input.GetKeyDown(KeyCode.Space) && player_move_s.p_sp > 0)
            {
                //弾インスタンス生成
                Instantiate(pb_prefab, transform.position, Quaternion.identity);
                player_move_s.p_sp--;
            }
        }
    }
Exemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        GameObject   game_control = GameObject.Find("Main Camera");
        Game_control game_script  = game_control.GetComponent <Game_control>();

        if (game_script.game_state == Game_control.PLAYING)
        {
            Cursor.visible = false;

            //FindObjectByType コンポーネント呼び出し
            mpos   = Input.mousePosition;       // Vector3でマウス位置座標を取得する
            mpos.z = 10f;                       // Z軸修正
                                                // マウス位置座標をスクリーン座標からワールド座標に変換する
            screenToWorldPointPosition = Camera.main.ScreenToWorldPoint(mpos);
            // ワールド座標に変換されたマウス座標を代入
            mpos = screenToWorldPointPosition;

            transform.position = mpos;
        }
    }
    // Use this for initialization
    void Start()
    {
        GameObject game_ctrl_obj = GameObject.FindWithTag("Game_control");

        game_ctrl = game_ctrl_obj.GetComponent <Game_control>();
    }
Exemplo n.º 10
0
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController");

        gameControl = gameControllerObject.GetComponent <Game_control>();
    }