コード例 #1
0
ファイル: _BulletSpawner.cs プロジェクト: Gkxd/Danmaku3D
    public Pair <GameObject, GameObject> createBullet()
    {
        GameObject bullet = GameObject.Instantiate(bulletPrefab);

        bullet.transform.position = transform.position;

        BulletVisual bulletVisual = bullet.GetComponent <BulletVisual>();

        bulletVisual.appearence = appearence;

        GameObject update = GameObject.Instantiate(bulletUpdate);

        update.transform.parent = bullet.transform;
        update.GetComponent <_BulletUpdate>().init(bulletLifetime, delaySeconds);

        return(new Pair <GameObject, GameObject>(bullet, update));
    }
コード例 #2
0
 public Factory(DefaultTowerVisual prefab, BulletVisual bulletPrefab)
 {
     _prefab       = prefab;
     _bulletPrefab = bulletPrefab;
 }