Exemple #1
0
        public void Extinguish()
        {
            PoolItem poolItem = m_poolManager.GetPoolItem(PoolType.Smoke);

            poolItem.GetComponent <Smoke>().Init(transform.position);

            OnExtinguish(m_scrollingObject);
        }
Exemple #2
0
    private void ShootProjectile()
    {
        //GameObject go = Instantiate(_bulletPrefab, transform.position, Quaternion.identity);
        PoolItem   go     = _bulletPool.GetAPoolObject();
        Projectile bullet = go.GetComponent <Projectile>();

        Vector3 direction = (Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position);

        direction.z = 0;

        bullet.Init(direction.normalized, _bulletData._bullets[_bulletIndex]);


        _audioPool.PlaySFX(_shootClip, transform.position);
    }
    private void ShootProjectile()
    {
        //GameObject go = Instantiate(_bulletPrefab, transform.position, Quaternion.identity);
        // Fetch bullet from pool
        PoolItem go = _bulletPool.GetAPoolObject();

        go.transform.position = transform.position;

        // Play clip from pool
        _audioPool.PlaySFX(_shootClip, transform.position);

        // Initialize projectile
        Projectile script    = go.GetComponent <Projectile>();
        Vector3    direction = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;

        direction.z = 0;
        script.Init(direction.normalized, _bulletData._bullets[_bulletIndex]);
    }