コード例 #1
0
    void shootBullet()
    {
        Vector3      offset            = getOffset();
        Vector3      newBulletLocation = this.transform.position;
        PlayerBullet newBullet         = bullet.GetPooledInstance <PlayerBullet>(newBulletLocation);

        newBullet.transform.Translate(offset);
        float vol = Random.Range(0.8f, 1.0f);

        source.pitch = (Random.Range(0.8f, 1.2f));
        source.PlayOneShot(shootSound, vol);
    }