예제 #1
0
    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;
 }