Exemple #1
0
    void spawnBullet()
    {
        // Instantiate(hiddenBullet, hiddenBulletEmitter.position, hiddenBulletEmitter.rotation);

        if (powerup)
        {
            if (!powerActivatedCheck)
            {
                Instantiate(roundEff, transform.position, Quaternion.identity);
                powerActivatedCheck = true;
                //lineParticle.SetActive(true);
                GameObject go = Instantiate(bigCircle, transform.position, Quaternion.identity);
                Destroy(go, 2f);
                Instantiate(BulletB, bulletEmitter.position, bulletEmitter.rotation);
                muzzleflash.Activate();

                //GameObject go2= Instantiate(BulletExplosion, bulletEmitter.position, bulletEmitter.rotation);
                //Destroy(go2,2f);
            }


            soundManager sm = GameObject.FindObjectOfType(typeof(soundManager)) as soundManager;
            sm.laserFn();
        }
        else
        {
            Instantiate(bullet, bulletEmitter.position, Quaternion.identity);
            muzzleflash.Activate();
            soundManager sm = GameObject.FindObjectOfType(typeof(soundManager)) as soundManager;
            sm.fireFn();

            /*  for (int i = 0; i < bulletEmitter.Length; i++)
             * {
             *    Instantiate(bullet, bulletEmitter[i].position, bulletEmitter[i].rotation);
             *    muzzleflash.Activate();
             *    soundManager sm = GameObject.FindObjectOfType(typeof(soundManager)) as soundManager;
             *    sm.fireFn();
             *    //CameraShaker.Instance.ShakeOnce(.5f, 1f, 0.1f, 0.01f);
             * }*/
        }
        //Time.timeScale = 0f;
    }