Пример #1
0
    void CreateBullet()
    {
        GameObject temp;

        if (_bulletPool == null)
        {
            _bulletPool = BulletPool_Player.instance;
        }

        temp = _bulletPool.PopPool(firePos, "Bullet_Normal");
        temp.SetActive(true);

        temp = _bulletPool.PopPool(firePos2, "Bullet_Normal");
        temp.SetActive(true);
        firePos2.Rotate(0, 0, -45);

        temp = _bulletPool.PopPool(firePos2, "Bullet_Normal");
        temp.SetActive(true);
        firePos2.Rotate(0, 0, 45);

        temp = _bulletPool.PopPool(firePos3, "Bullet_Normal");
        temp.SetActive(true);
        firePos3.Rotate(0, 0, 45);

        temp = _bulletPool.PopPool(firePos3, "Bullet_Normal");
        temp.SetActive(true);
        firePos3.Rotate(0, 0, -45);
    }
Пример #2
0
    // 한 번에 만들어 둘 것인가, 필요할 때마다 만들 것인가...
    // 일단 필요할 때 마다 만드는 방향으로 감
    private void Init(Transform parent)
    {
        instance = this;
        pos      = this.transform.position;

        _prefabs = Prefabs_Manager.instance.Prefabs_Get_Player_All();

        foreach (var key in _prefabs.Keys)
        {
            Debug.Log(key);
            _poolList.Add(key, new List <GameObject>());
        }
    }