public void LavaExplosion(Transform spawnPos)
 {
     particleHost.position = spawnPos.position;
     for (int i = 0; i < maxParticles / 2; i++)
     {
         float randomSpeed = UnityEngine.Random.Range(minSpeed, maxSpeed);
         objectPool.GetObj().InitialiseObj(GunFunctions.calcSpreadShot(transform.position, -minSpread, maxSpread), minSpread, maxSpread, randomSpeed, spawnPos);
     }
 }
示例#2
0
    //Special attack
    public override IEnumerator Special()
    {
        for (int i = 0; i < specialBulletAmount; i++)
        {
            Quaternion rot = GunFunctions.calcSpreadShot(this.transform.position, -minSpread, maxSpread);
            GameObject go  = Instantiate(specialBulletPrefab, shootPos.transform.position, rot);
            go.GetComponent <IBullet>().SetupStats(specialBulletSpeed, specialBulletDmg, new Vector2(1, 0));
            //Feedback
            GunFunctions.KnockBack(player.GetComponent <Rigidbody2D>(), (rot * transform.right * -1), shotForce);
            StartCoroutine(cam.GetComponent <CameraScript>().CameraShake(shotCameraShakeForce, shotCameraDuration + 0.2f));

            //Wouter HeavyGunShot
            FMODUnity.RuntimeManager.PlayOneShot("event:/Weapon/GrenadeLauncherShot");
        }
        yield return(null);
    }
示例#3
0
    public IEnumerator SpewLavaOverTime()
    {
        float t = 0;

        while (true)
        {
            yield return(null);

            float randomSpeed = UnityEngine.Random.Range(minSpeed, maxSpeed);
            objectPool.GetObj().InitialiseObj(GunFunctions.calcSpreadShot(transform.position, -minSpread, maxSpread), minSpread, maxSpread, randomSpeed, spawnPos);
            t += Time.deltaTime;
            if (t > spewTime)
            {
                break;
            }
        }
    }