コード例 #1
0
    private void GetBullet(Vector3 pos, Quaternion rot)
    {
        Transform bullet = _poolManager.GetBulletFromPool();

        bullet.position = pos;
        bullet.rotation = rot;

        Bullet bulletScript = bullet.GetComponent <Bullet>();

        if (bulletScript != null)
        {
            if (gameObject.GetComponent <Player>() != null)
            {
                bulletScript.AssignBulletToPlayer();
            }

            bulletScript.AssignDamage(_shipScript.DamageOther);
        }

        bullet.gameObject.SetActive(true);
    }