Ejemplo n.º 1
0
    void FixedUpdate()
    {
        //Destroy the object if life is lower than 0
        if (lifeScript.GetLife() <= 0)
        {
            for (int i = 0; i < numberOfPoints; i++)
            {
                GameObject point = poolPoint.GetBullet();
                point.transform.position = new Vector2(Random.Range(transform.position.x - pointSpawnRadius, transform.position.x + pointSpawnRadius), Random.Range(transform.position.y - pointSpawnRadius, transform.position.y + pointSpawnRadius));
                point.SetActive(true);
            }

            particlesContainer.transform.SetParent(null);
            SoundManager.instance.Play(SoundManager.clip.enemyDeath);
            if (!Application.isEditor)
            {
                VibrationController.Vibrate(50);
            }
            if (dropUpgrade)
            {
                Instantiate(upgradeObject, transform.position, Quaternion.identity);
            }
            Destroy(gameObject);
        }

        //Rotate the object
        rotateObject.transform.Rotate(Vector3.forward * Time.deltaTime * rotationSpeed);
    }
Ejemplo n.º 2
0
    public void FireWeapon()
    {
        if (current_ammo != 0)
        {
            current_ammo -= 1;

            m_projectile_fire_sequence.Fire();
            // TODO: m_weapon_audio.PlayFireGunSFX();
            m_vibration_controller.Vibrate(on_fire_vibration_length, on_fire_vibration_strength);
            // TODO: m_camera_shake_controller.ShakeCamera(new ShakeProperties(on_fire_shake_distance, on_fire_shake_duration));
            m_gun_gui_controller.SetClipStatus(current_ammo, clip_size);

            PlayMuzzleFlashAnimation();
            FireProjectileCallback();

            if (current_ammo == 0 && should_auto_reload)
            {
                Reload();
            }
        }
        else
        {
            // TODO: m_weapon_audio.PlayDryFireSFX();
        }
    }
Ejemplo n.º 3
0
 void ClickEffect()
 {
     SoundManager.instance.Play(SoundManager.clip.ButtonClick);
     if (!Application.isEditor)
     {
         VibrationController.Vibrate(50);
     }
 }
Ejemplo n.º 4
0
 public void Continue()
 {
     SoundManager.instance.Play(SoundManager.clip.ButtonClick);
     if (!Application.isEditor)
     {
         VibrationController.Vibrate(50);
     }
     StartCoroutine(FadeIn());
 }
    private void Explode()
    {
        Instantiate(m_ExplosionEffect, transform.position, Quaternion.identity);

        VibrationController.Vibrate(200);

        Messenger.Broadcast(GameEvent.INEDIBLE_ITEM_PICKUP);

        Destroy(gameObject);
    }
Ejemplo n.º 6
0
    public void RegisterAudio()
    {
        float volume    = slider.value;
        float vibration = (130 * volume);

        if (!Application.isEditor)
        {
            VibrationController.Vibrate((long)vibration);
        }
        if (volume >= 0)
        {
            xmlSystem.dataBase.firstDB[1].value = volume;

            xmlSystem.Save();
        }
    }