コード例 #1
0
 protected void InstBullet()
 {
     lastShotTime = Time.time;
     if (param.shotSound != null)
     {
         audioSource.PlayOneShot(param.shotSound);
     }
     EnemyBullet b = EnemyBullet.Instantiate(bullet, param, transform);
 }
コード例 #2
0
    IEnumerator Shoot()
    {
        while (true)
        {
            eB.Instantiate(bullet, hana.position, hana.rotation, planet, planet, player); Debug.Log("1");
            //発射音を再生
            SoundController.soundNumber = 2;
            yield return(new WaitForSeconds(2.0f));

            eB.Instantiate(bullet, hana.position, hana.rotation, planet, planet, player); Debug.Log("2");
            //発射音を再生
            SoundController.soundNumber = 2;
            yield return(new WaitForSeconds(1.0f));

            eB.Instantiate(bullet, hana.position, hana.rotation, planet, planet, player); Debug.Log("3");
            //発射音を再生
            SoundController.soundNumber = 2;
            yield return(new WaitForSeconds(3.0f));
        }
    }
コード例 #3
0
    // 主に座標を渡す
    protected void InstBullet(float _x, float _y)
    {
        lastShotTime = Time.time;
        if (param.shotSound != null)
        {
            audioSource.PlayOneShot(param.shotSound);
        }
        EnemyBullet b = EnemyBullet.Instantiate(bullet, param, transform);

        b.transform.Rotate(new Vector2(_x, _y).normalized);
    }
コード例 #4
0
    // 主に角度を渡す
    protected void InstBullet(float _rad)
    {
        lastShotTime = Time.time;
        if (param.shotSound != null)
        {
            audioSource.PlayOneShot(param.shotSound);
        }
        EnemyBullet b = EnemyBullet.Instantiate(bullet, param, transform);

        b.transform.Rotate(new Vector2(Mathf.Cos(_rad), Mathf.Sin(_rad)));
    }
コード例 #5
0
    public override void Move()
    {
        base.Move();

        if (Time.time - startTime >= 1)
        {
            Debug.Log("unlimited......");
            UnlimitedLostWorksChild b;
            b = EnemyBullet.Instantiate(bullet, this.param, transform) as UnlimitedLostWorksChild;
            b.transform.Rotate(new Vector3(0, 0, 1), 210);

            b = EnemyBullet.Instantiate(bullet, this.param, transform) as UnlimitedLostWorksChild;
            b.transform.Rotate(new Vector3(0, 0, 1), 180);

            b = EnemyBullet.Instantiate(bullet, this.param, transform) as UnlimitedLostWorksChild;
            b.transform.Rotate(new Vector3(0, 0, 1), 150);

            Destroy(this.gameObject);
        }
    }