Esempio n. 1
0
    void WaveCompleted()
    {
        //begin new round
        Debug.Log("Wave Complete");

        state         = SpawnState.COUNTING;
        waveCountdown = timeBetweenWaves;

        /* instead of this if
         * a random wave selection variable can
         * be used.
         */
        //nextWave = Random.Range(0, waves.Length);
        if (nextWave + 1 > waves.Length - 1)
        {
            nextWave = 0;
            Debug.Log("All waves done");

            return;
        }

        nextWave++;
        audioManager = AudioStuff.AudioManager.instance;
        audioManager.PlaySound("WaveComplete");
    }
Esempio n. 2
0
    void BullEffect(Vector3 hitPosition, Vector3 hitNormal)
    {
        Transform    trail = Instantiate(BulletEffect, firePoint.position, firePoint.rotation) as Transform;
        LineRenderer lr    = trail.GetComponent <LineRenderer>();

        if (lr != null)
        {
            //SET POSITION
            lr.SetPosition(0, firePoint.position);
            lr.SetPosition(1, hitPosition);
        }

        Destroy(trail.gameObject, 0.02f);

        if (hitNormal != new Vector3(9999, 9999, 9999))
        {
            Transform hit = Instantiate(hitPrefab, hitPosition, Quaternion.FromToRotation(Vector3.right, hitNormal)) as Transform;
            Destroy(hit.gameObject, 1f);
        }

        Transform MuzzleClone = (Transform)Instantiate(MuzzleFlash, firePoint.position, firePoint.rotation);
        float     size        = Random.Range(1f, 2.0f);

        MuzzleClone.localScale = new Vector3(size, size, size);
        Destroy(MuzzleClone.gameObject, 0.02f);
        //shake camera
        camShake.Shake(camShakeAmt, length);
        audioManager = AudioStuff.AudioManager.instance;
        audioManager.PlaySound("GunSound");
    }
Esempio n. 3
0
    public IEnumerator _RespawnPlayer()
    {
        //"TODO: Add fancy particle system and sounds");
        audioManager = AudioStuff.AudioManager.instance;
        audioManager.PlaySound(spawnSoundName);
        yield return(new WaitForSeconds(spawnDelay));

        Instantiate(playerPrefab, spawnPoint.position, spawnPoint.rotation);
        GameObject ss = Instantiate(spawnPrefab, spawnPoint.position, spawnPoint.rotation).gameObject as GameObject;

        Destroy(ss, 3f);
    }
Esempio n. 4
0
    public void DamagePlayer(int damage)
    {
        stats.curHealth -= damage;
        audioManager     = AudioStuff.AudioManager.instance;

        if (stats.curHealth <= 0)
        {
            audioManager.PlaySound("PlayerDead");
            GameMaster.KillPlayer(this);
            Debug.Log("No player on the properties panel lol");
            return;
        }

        statusIndicator.SetHealth(stats.curHealth, stats.maxHealth);
        audioManager.PlaySound("PlayerDamage");
    }
Esempio n. 5
0
    void Start()
    {
        if (cameraShake == null)
        {
            Debug.LogError("No camera shaker found");
        }
        _remainingLives = maxLives;
        //caching
        audioManager = AudioStuff.AudioManager.instance;
        if (audioManager == null)
        {
            Debug.LogError("No audio manager found in scene");
        }

        audioManager.PlaySound("Signature");
    }
Esempio n. 6
0
    public void DamageEnemy(int damage)
    {
        audioManager     = AudioStuff.AudioManager.instance;
        stats.curHealth -= damage;
        if (stats.curHealth <= 0)
        {
            GameMaster.KillEnemy(this);
            audioManager.PlaySound("EnemyDead");
            //Debug.Log("Some Spaceship died");
        }

        if (statusIndicator != null)
        {
            statusIndicator.SetHealth(stats.curHealth, stats.maxHealth);
        }
    }