Example #1
0
 protected void InstBullet()
 {
     lastShotTime = Time.time;
     if (param.shotSound != null)
     {
         audioSource.PlayOneShot(param.shotSound);
     }
     EnemyBullet b = EnemyBullet.Instantiate(bullet, param, transform);
 }
Example #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));
        }
    }
Example #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);
    }
Example #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)));
    }
Example #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);
        }
    }